Class: LaunchDarkly::RedisFeatureStore Deprecated
- Inherits:
-
Object
- Object
- LaunchDarkly::RedisFeatureStore
- Includes:
- Interfaces::FeatureStore
- Defined in:
- lib/ldclient-rb/redis_store.rb
Overview
Use the factory method in Integrations::Redis instead. This specific implementation class may be changed or removed in the future.
An implementation of the LaunchDarkly client's feature store that uses a Redis instance. This object holds feature flags and related data received from the streaming API. Feature data can also be further cached in memory to reduce overhead of calls to Redis.
To use this class, you must first have the redis
and connection-pool
gems
installed. Then, create an instance and store it in the feature_store
property
of your client configuration.
Class Method Summary collapse
-
.default_prefix ⇒ Object
Default value for the
prefix
constructor parameter. -
.default_redis_url ⇒ Object
Default value for the
redis_url
constructor parameter; points to an instance of Redis running atlocalhost
with its default port.
Instance Method Summary collapse
- #all(kind) ⇒ Object
- #delete(kind, key, version) ⇒ Object
- #get(kind, key) ⇒ Object
- #init(all_data) ⇒ Object
-
#initialize(opts = {}) ⇒ RedisFeatureStore
constructor
Constructor for a RedisFeatureStore instance.
- #initialized? ⇒ Boolean
- #stop ⇒ Object
- #upsert(kind, item) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ RedisFeatureStore
Constructor for a RedisFeatureStore instance.
40 41 42 43 |
# File 'lib/ldclient-rb/redis_store.rb', line 40 def initialize(opts = {}) core = LaunchDarkly::Impl::Integrations::Redis::RedisFeatureStoreCore.new(opts) @wrapper = LaunchDarkly::Integrations::Util::CachingStoreWrapper.new(core, opts) end |
Class Method Details
.default_prefix ⇒ Object
Default value for the prefix
constructor parameter.
56 57 58 |
# File 'lib/ldclient-rb/redis_store.rb', line 56 def self.default_prefix LaunchDarkly::Integrations::Redis::default_prefix end |
.default_redis_url ⇒ Object
Default value for the redis_url
constructor parameter; points to an instance of Redis
running at localhost
with its default port.
49 50 51 |
# File 'lib/ldclient-rb/redis_store.rb', line 49 def self.default_redis_url LaunchDarkly::Integrations::Redis::default_redis_url end |
Instance Method Details
#all(kind) ⇒ Object
64 65 66 |
# File 'lib/ldclient-rb/redis_store.rb', line 64 def all(kind) @wrapper.all(kind) end |
#delete(kind, key, version) ⇒ Object
68 69 70 |
# File 'lib/ldclient-rb/redis_store.rb', line 68 def delete(kind, key, version) @wrapper.delete(kind, key, version) end |
#get(kind, key) ⇒ Object
60 61 62 |
# File 'lib/ldclient-rb/redis_store.rb', line 60 def get(kind, key) @wrapper.get(kind, key) end |
#init(all_data) ⇒ Object
72 73 74 |
# File 'lib/ldclient-rb/redis_store.rb', line 72 def init(all_data) @wrapper.init(all_data) end |
#initialized? ⇒ Boolean
80 81 82 |
# File 'lib/ldclient-rb/redis_store.rb', line 80 def initialized? @wrapper.initialized? end |
#stop ⇒ Object
84 85 86 |
# File 'lib/ldclient-rb/redis_store.rb', line 84 def stop @wrapper.stop end |
#upsert(kind, item) ⇒ Object
76 77 78 |
# File 'lib/ldclient-rb/redis_store.rb', line 76 def upsert(kind, item) @wrapper.upsert(kind, item) end |