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 29 |
# 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 @stopped = false # @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.
39 40 41 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 39 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.
47 48 49 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 47 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.
35 36 37 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 35 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.
31 32 33 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 31 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.
51 52 53 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 51 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.
67 68 69 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 67 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.
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 55 def stop @store.stop poller = @mutex.synchronize do @stopped = true task = @poller @poller = nil task end poller&.stop 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.
43 44 45 |
# File 'lib/ldclient-rb/impl/store_client_wrapper.rb', line 43 def upsert(kind, item) wrapper { @store.upsert(kind, item) } end |