Class: LaunchDarkly::Impl::DataSystem::PollingDataSourceBuilder 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 a 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

#initializePollingDataSourceBuilder

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 PollingDataSourceBuilder.

Since:

  • 5.5.0



538
539
540
# File 'lib/ldclient-rb/impl/data_system/polling.rb', line 538

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.

Parameters:

Returns:

Since:

  • 5.5.0



571
572
573
574
575
# File 'lib/ldclient-rb/impl/data_system/polling.rb', line 571

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

#poll_interval(secs) ⇒ PollingDataSourceBuilder

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.

Parameters:

  • secs (Float)

    Polling interval in seconds

Returns:

Since:

  • 5.5.0



548
549
550
551
# File 'lib/ldclient-rb/impl/data_system/polling.rb', line 548

def poll_interval(secs)
  @poll_interval = secs
  self
end

#requester(requester) ⇒ PollingDataSourceBuilder

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.

Parameters:

Returns:

Since:

  • 5.5.0



559
560
561
562
# File 'lib/ldclient-rb/impl/data_system/polling.rb', line 559

def requester(requester)
  @requester = requester
  self
end