Class: LaunchDarkly::Impl::DataSystem::FDv1PollingDataSourceBuilder Private

Inherits:
Object
  • Object
show all
Includes:
DataSourceBuilderCommon
Defined in:
lib/ldclient-rb/impl/data_system/polling.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Builder for an FDv1 PollingDataSource.

Since:

  • 5.5.0

Constant Summary collapse

DEFAULT_BASE_URI =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 5.5.0

"https://sdk.launchdarkly.com"
DEFAULT_POLL_INTERVAL =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 5.5.0

30

Instance Method Summary collapse

Methods included from DataSourceBuilderCommon

#base_uri, #connect_timeout, #read_timeout, #socket_factory

Constructor Details

#initializeFDv1PollingDataSourceBuilder

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of FDv1PollingDataSourceBuilder.

Since:

  • 5.5.0



587
588
589
# File 'lib/ldclient-rb/impl/data_system/polling.rb', line 587

def initialize
  @requester = nil
end

Instance Method Details

#build(sdk_key, config) ⇒ PollingDataSource

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Builds the PollingDataSource with the configured parameters.

Since:

  • 5.5.0



620
621
622
623
624
# File 'lib/ldclient-rb/impl/data_system/polling.rb', line 620

def build(sdk_key, config)
  http_opts = build_http_config
  requester = @requester || HTTPFDv1PollingRequester.new(sdk_key, http_opts, config)
  PollingDataSource.new(@poll_interval || DEFAULT_POLL_INTERVAL, requester, config.logger)
end

#poll_interval(secs) ⇒ FDv1PollingDataSourceBuilder

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Sets the polling interval in seconds.

Since:

  • 5.5.0



597
598
599
600
# File 'lib/ldclient-rb/impl/data_system/polling.rb', line 597

def poll_interval(secs)
  @poll_interval = secs
  self
end

#requester(requester) ⇒ FDv1PollingDataSourceBuilder

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Sets a custom Requester for the PollingDataSource.

Since:

  • 5.5.0



608
609
610
611
# File 'lib/ldclient-rb/impl/data_system/polling.rb', line 608

def requester(requester)
  @requester = requester
  self
end