@@ -32,6 +32,18 @@ class LDClient
3232
3333 def_delegators :@config , :logger
3434
35+ # @!method flush
36+ # Delegates to {LaunchDarkly::EventProcessorMethods#flush}.
37+ def_delegator :@event_processor , :flush
38+
39+ # @!method data_store_status_provider
40+ # Delegates to the data system {LaunchDarkly::Impl::DataSystem#data_store_status_provider}.
41+ # @return [LaunchDarkly::Interfaces::DataStore::StatusProvider]
42+ # @!method data_source_status_provider
43+ # Delegates to the data system {LaunchDarkly::Impl::DataSystem#data_source_status_provider}.
44+ # @return [LaunchDarkly::Interfaces::DataSource::StatusProvider]
45+ def_delegators :@data_system , :data_store_status_provider , :data_source_status_provider
46+
3547 #
3648 # Creates a new client instance that connects to LaunchDarkly. A custom
3749 # configuration parameter can also supplied to specify advanced options,
@@ -50,11 +62,13 @@ class LDClient
5062 #
5163 def initialize ( sdk_key , config = Config . default , wait_for_sec = 5 )
5264 # Note that sdk_key is normally a required parameter, and a nil value would cause the SDK to
53- # fail in most configurations. However, there are some configurations where it would be OK
54- # (offline = true, *or* we are using LDD mode or the file data source and events are disabled
55- # so we're not connecting to any LD services).
65+ # fail in most configurations. However, there are some configurations where it would be OK to
66+ # not provide a SDK key.
67+ # * Offline mode
68+ # * Using LDD mode with events disabled
69+ # * Using a custom data source (like FileData) with events disabled
5670 if !config . offline? && sdk_key . nil?
57- # SDK key can be nil only if using LDD or custom data source with events disabled
71+ # If the data source is nil we create a default data source which requires the SDK key.
5872 if config . send_events || ( !config . use_ldd? && config . data_source . nil? )
5973 raise ArgumentError , "sdk_key must not be nil"
6074 end
@@ -206,22 +220,6 @@ def add_hook(hook)
206220 @hooks . push ( hook )
207221 end
208222
209- #
210- # Tells the client that all pending analytics events should be delivered as soon as possible.
211- #
212- # When the LaunchDarkly client generates analytics events (from {#variation}, {#variation_detail},
213- # {#identify}, or {#track}), they are queued on a worker thread. The event thread normally
214- # sends all queued events to LaunchDarkly at regular intervals, controlled by the
215- # {Config#flush_interval} option. Calling `flush` triggers a send without waiting for the
216- # next interval.
217- #
218- # Flushing is asynchronous, so this method will return before it is complete. However, if you
219- # call {#close}, events are guaranteed to be sent before that method returns.
220- #
221- def flush
222- @event_processor . flush
223- end
224-
225223 #
226224 # Creates a hash string that can be used by the JavaScript SDK to identify a context.
227225 # For more information, see [Secure mode](https://docs.launchdarkly.com/sdk/features/secure-mode#ruby).
@@ -639,37 +637,6 @@ def close
639637 #
640638 attr_reader :big_segment_store_status_provider
641639
642- #
643- # Returns an interface for tracking the status of a persistent data store.
644- #
645- # The {LaunchDarkly::Interfaces::DataStore::StatusProvider} has methods for
646- # checking whether the data store is (as far as the SDK knows) currently
647- # operational, tracking changes in this status, and getting cache
648- # statistics. These are only relevant for a persistent data store; if you
649- # are using an in-memory data store, then this method will return a stub
650- # object that provides no information.
651- #
652- # @return [LaunchDarkly::Interfaces::DataStore::StatusProvider]
653- #
654- def data_store_status_provider
655- @data_system . data_store_status_provider
656- end
657-
658- #
659- # Returns an interface for tracking the status of the data source.
660- #
661- # The data source is the mechanism that the SDK uses to get feature flag
662- # configurations, such as a streaming connection (the default) or poll
663- # requests. The {LaunchDarkly::Interfaces::DataSource::StatusProvider} has
664- # methods for checking whether the data source is (as far as the SDK knows)
665- # currently operational and tracking changes in this status.
666- #
667- # @return [LaunchDarkly::Interfaces::DataSource::StatusProvider]
668- #
669- def data_source_status_provider
670- @data_system . data_source_status_provider
671- end
672-
673640 #
674641 # Returns an interface for tracking changes in feature flag configurations.
675642 #
0 commit comments