Class: LaunchDarkly::Impl::DataSource::StatusProvider
- Inherits:
-
Object
- Object
- LaunchDarkly::Impl::DataSource::StatusProvider
- Extended by:
- Forwardable
- Defined in:
- lib/ldclient-rb/impl/data_source.rb
Overview
Instance Method Summary collapse
-
#add_listener(listener) ⇒ Object
included
from LaunchDarkly::Interfaces::DataSource::StatusProvider
Subscribes for notifications of status changes.
-
#initialize(status_broadcaster, update_sink) ⇒ StatusProvider
constructor
A new instance of StatusProvider.
-
#remove_listener(listener) ⇒ Object
included
from LaunchDarkly::Interfaces::DataSource::StatusProvider
Unsubscribes from notifications of status changes.
- #status ⇒ Object
Constructor Details
#initialize(status_broadcaster, update_sink) ⇒ StatusProvider
Returns a new instance of StatusProvider.
16 17 18 19 20 21 |
# File 'lib/ldclient-rb/impl/data_source.rb', line 16 def initialize(status_broadcaster, update_sink) # @type [Broadcaster] @status_broadcaster = status_broadcaster # @type [UpdateSink] @data_source_update_sink = update_sink end |
Instance Method Details
#add_listener(listener) ⇒ Object Originally defined in module LaunchDarkly::Interfaces::DataSource::StatusProvider
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.
#remove_listener(listener) ⇒ Object Originally defined in module LaunchDarkly::Interfaces::DataSource::StatusProvider
Unsubscribes from notifications of status changes.
#status ⇒ Object
23 24 25 |
# File 'lib/ldclient-rb/impl/data_source.rb', line 23 def status @data_source_update_sink.current_status end |