Module: LaunchDarkly::Interfaces::DataSource::StatusProvider
- Included in:
 - LaunchDarkly::Impl::DataSource::StatusProvider
 
- Defined in:
 - lib/ldclient-rb/interfaces/data_source.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.
      77  | 
    
      # File 'lib/ldclient-rb/interfaces/data_source.rb', line 77 def add_listener(listener) end  | 
  
#remove_listener(listener) ⇒ Object
Unsubscribes from notifications of status changes.
      82  | 
    
      # File 'lib/ldclient-rb/interfaces/data_source.rb', line 82 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.
      63 64  | 
    
      # File 'lib/ldclient-rb/interfaces/data_source.rb', line 63 def status end  |