Module: LaunchDarkly::Impl::DataSource Private

Defined in:
lib/ldclient-rb/impl/data_source.rb,
lib/ldclient-rb/impl/data_source/null_processor.rb,
lib/ldclient-rb/impl/data_source/polling.rb,
lib/ldclient-rb/impl/data_source/requestor.rb,
lib/ldclient-rb/impl/data_source/status_provider.rb,
lib/ldclient-rb/impl/data_source/stream.rb

Overview

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

Since:

  • 5.5.0

Defined Under Namespace

Classes: NullUpdateProcessor, PollingProcessor, Requestor, StatusProvider, StatusProviderV2, StreamProcessor, UnexpectedResponseError, UpdateSink

Constant Summary collapse

LD_ENVID_HEADER =

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

"X-LD-EnvID"
PUT =

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

:put
PATCH =

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

:patch
DELETE =

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

:delete
READ_TIMEOUT_SECONDS =

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.

5 minutes; the stream should send a ping every 3 minutes

Since:

  • 5.5.0

300
KEY_PATHS =

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

{
  Impl::DataStore::FEATURES => "/flags/",
  Impl::DataStore::SEGMENTS => "/segments/",
}

Class Method Summary collapse

Class Method Details

.record_environment_id(sink, headers) ⇒ void

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.

This method returns an undefined value.

Records the environment ID reported by LaunchDarkly, when the response headers provide one and the sink is able to hold it. Externally implemented sinks are not required to support this.

Parameters:

Since:

  • 5.5.0



20
21
22
23
24
25
26
27
28
29
# File 'lib/ldclient-rb/impl/data_source.rb', line 20

def self.record_environment_id(sink, headers)
  return if headers.nil? || !sink.respond_to?(:set_environment_id)

  environment_id = headers[LD_ENVID_HEADER]
  # The http gem returns arrays for repeated headers; normalize to a string.
  environment_id = environment_id.first if environment_id.is_a?(Array)
  return unless environment_id.is_a?(String) && !environment_id.empty?

  sink.set_environment_id(environment_id)
end