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.
39 40 41 42 |
# File 'lib/ldclient-rb/redis_store.rb', line 39 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.
55 56 57 |
# File 'lib/ldclient-rb/redis_store.rb', line 55 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.
48 49 50 |
# File 'lib/ldclient-rb/redis_store.rb', line 48 def self.default_redis_url LaunchDarkly::Integrations::Redis::default_redis_url end |
Instance Method Details
#all(kind) ⇒ Object
63 64 65 |
# File 'lib/ldclient-rb/redis_store.rb', line 63 def all(kind) @wrapper.all(kind) end |
#delete(kind, key, version) ⇒ Object
67 68 69 |
# File 'lib/ldclient-rb/redis_store.rb', line 67 def delete(kind, key, version) @wrapper.delete(kind, key, version) end |
#get(kind, key) ⇒ Object
59 60 61 |
# File 'lib/ldclient-rb/redis_store.rb', line 59 def get(kind, key) @wrapper.get(kind, key) end |
#init(all_data) ⇒ Object
71 72 73 |
# File 'lib/ldclient-rb/redis_store.rb', line 71 def init(all_data) @wrapper.init(all_data) end |
#initialized? ⇒ Boolean
79 80 81 |
# File 'lib/ldclient-rb/redis_store.rb', line 79 def initialized? @wrapper.initialized? end |
#stop ⇒ Object
83 84 85 |
# File 'lib/ldclient-rb/redis_store.rb', line 83 def stop @wrapper.stop end |
#upsert(kind, item) ⇒ Object
75 76 77 |
# File 'lib/ldclient-rb/redis_store.rb', line 75 def upsert(kind, item) @wrapper.upsert(kind, item) end |