Module: LaunchDarkly::Interfaces::DataSource::StatusProvider
- Included in:
- LaunchDarkly::Impl::DataSource::StatusProvider
- Defined in:
- lib/ldclient-rb/interfaces.rb
Overview
An interface for querying the status of the SDK’s data source. The data source is the component that receives updates to feature flag data; normally this is a streaming connection, but it could be polling or file data depending on your configuration.
An implementation of this interface is returned by LDClient#data_source_status_provider. Application code never needs to implement this interface.
Instance Method Summary collapse
-
#add_listener(listener) ⇒ Object
Subscribes for notifications of status changes.
-
#remove_listener(listener) ⇒ Object
Unsubscribes from notifications of status changes.
-
#status ⇒ Status
Returns the current status of the data source.
Instance Method Details
#add_listener(listener) ⇒ Object
Subscribes for notifications of status changes.
The listener will be notified whenever any property of the status has changed. See LaunchDarkly::Interfaces::DataSource::Status for an explanation of the meaning of each property and what could cause it to change.
Notifications will be dispatched on a worker thread. It is the listener’s responsibility to return as soon as possible so as not to block subsequent notifications.
604 |
# File 'lib/ldclient-rb/interfaces.rb', line 604 def add_listener(listener) end |
#remove_listener(listener) ⇒ Object
Unsubscribes from notifications of status changes.
609 |
# File 'lib/ldclient-rb/interfaces.rb', line 609 def remove_listener(listener) end |
#status ⇒ Status
Returns the current status of the data source.
All of the built-in data source implementations are guaranteed to update this status whenever they successfully initialize, encounter an error, or recover after an error.
For a custom data source implementation, it is the responsibility of the data source to push status updates to the SDK; if it does not do so, the status will always be reported as LaunchDarkly::Interfaces::DataSource::Status::INITIALIZING.
590 591 |
# File 'lib/ldclient-rb/interfaces.rb', line 590 def status end |