Class: LaunchDarkly::Impl::DataStore::StatusProvider

Inherits:
Object
  • Object
show all
Includes:
LaunchDarkly::Interfaces::DataStore::StatusProvider
Defined in:
lib/ldclient-rb/impl/data_store.rb

Overview

Since:

  • 5.5.0

Instance Method Summary collapse

Constructor Details

#initialize(store, update_sink) ⇒ StatusProvider

Returns a new instance of StatusProvider.

Since:

  • 5.5.0



60
61
62
63
64
65
# File 'lib/ldclient-rb/impl/data_store.rb', line 60

def initialize(store, update_sink)
  # @type [LaunchDarkly::Impl::FeatureStoreClientWrapper]
  @store = store
  # @type [UpdateSink]
  @update_sink = update_sink
end

Instance Method Details

#add_listener(listener) ⇒ Object

Since:

  • 5.5.0



75
76
77
# File 'lib/ldclient-rb/impl/data_store.rb', line 75

def add_listener(listener)
  @update_sink.broadcaster.add_listener(listener)
end

#monitoring_enabled?Boolean

Returns:

  • (Boolean)

Since:

  • 5.5.0



71
72
73
# File 'lib/ldclient-rb/impl/data_store.rb', line 71

def monitoring_enabled?
  @store.monitoring_enabled?
end

#remove_listener(listener) ⇒ Object

Since:

  • 5.5.0



79
80
81
# File 'lib/ldclient-rb/impl/data_store.rb', line 79

def remove_listener(listener)
  @update_sink.broadcaster.remove_listener(listener)
end

#statusObject

Since:

  • 5.5.0



67
68
69
# File 'lib/ldclient-rb/impl/data_store.rb', line 67

def status
  @update_sink.last_status.get
end