Class: LaunchDarkly::Impl::FeatureStoreClientWrapper Private
- Inherits:
-
Object
- Object
- LaunchDarkly::Impl::FeatureStoreClientWrapper
- Includes:
- LaunchDarkly::Interfaces::FeatureStore
- Defined in:
- lib/ldclient-rb/impl/store_client_wrapper.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Provides additional behavior that the client requires before or after feature store operations. This just means sorting the data set for init() and dealing with data store status listeners.
Instance Method Summary collapse
- #all(kind) ⇒ Object private
- #delete(kind, key, version) ⇒ Object private
- #get(kind, key) ⇒ Object private
- #init(all_data) ⇒ Object private
-
#initialize(store, store_update_sink, logger) ⇒ FeatureStoreClientWrapper
constructor
private
A new instance of FeatureStoreClientWrapper.
- #initialized? ⇒ Boolean private
- #monitoring_enabled? ⇒ Boolean private
- #stop ⇒ Object private
- #upsert(kind, item) ⇒ Object private
Constructor Details
#initialize(store, store_update_sink, logger) ⇒ FeatureStoreClientWrapper
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of FeatureStoreClientWrapper.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 14 def initialize(store, store_update_sink, logger) # @type [LaunchDarkly::Interfaces::FeatureStore] @store = store @monitoring_enabled = does_store_support_monitoring? # @type [LaunchDarkly::Impl::DataStore::UpdateSink] @store_update_sink = store_update_sink @logger = logger @mutex = Mutex.new # Covers the following variables @last_available = true # @type [LaunchDarkly::Impl::RepeatingTask, nil] @poller = nil end |
Instance Method Details
#all(kind) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
38 39 40 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 38 def all(kind) wrapper { @store.all(kind) } end |
#delete(kind, key, version) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
46 47 48 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 46 def delete(kind, key, version) wrapper { @store.delete(kind, key, version) } end |
#get(kind, key) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
34 35 36 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 34 def get(kind, key) wrapper { @store.get(kind, key) } end |
#init(all_data) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 30 def init(all_data) wrapper { @store.init(FeatureStoreDataSetSorter.sort_all_collections(all_data)) } end |
#initialized? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
50 51 52 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 50 def initialized? @store.initialized? end |
#monitoring_enabled? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
64 65 66 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 64 def monitoring_enabled? @monitoring_enabled end |
#stop ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
54 55 56 57 58 59 60 61 62 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 54 def stop @store.stop @mutex.synchronize do return if @poller.nil? @poller.stop @poller = nil end end |
#upsert(kind, item) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
42 43 44 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 42 def upsert(kind, item) wrapper { @store.upsert(kind, item) } end |