Class: LaunchDarkly::Impl::Integrations::Redis::RedisFeatureStore
- Inherits:
-
Object
- Object
- LaunchDarkly::Impl::Integrations::Redis::RedisFeatureStore
- Includes:
- LaunchDarkly::Interfaces::FeatureStore
- Defined in:
- lib/ldclient-rb/impl/integrations/redis_impl.rb
Overview
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
prefixconstructor parameter. -
.default_redis_url ⇒ Object
Default value for the
redis_urlconstructor parameter; points to an instance of Redis running atlocalhostwith its default port.
Instance Method Summary collapse
- #all(kind) ⇒ Object
- #available? ⇒ Boolean
- #delete(kind, key, version) ⇒ Object
- #get(kind, key) ⇒ Object
- #init(all_data) ⇒ Object
-
#initialize(opts = {}) ⇒ RedisFeatureStore
constructor
Constructor for a RedisFeatureStore instance.
- #initialized? ⇒ Boolean
- #monitoring_enabled? ⇒ 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/impl/integrations/redis_impl.rb', line 40 def initialize(opts = {}) core = 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.
64 65 66 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 64 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.
57 58 59 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 57 def self.default_redis_url LaunchDarkly::Integrations::Redis::default_redis_url end |
Instance Method Details
#all(kind) ⇒ Object
72 73 74 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 72 def all(kind) @wrapper.all(kind) end |
#available? ⇒ Boolean
49 50 51 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 49 def available? @wrapper.available? end |
#delete(kind, key, version) ⇒ Object
76 77 78 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 76 def delete(kind, key, version) @wrapper.delete(kind, key, version) end |
#get(kind, key) ⇒ Object
68 69 70 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 68 def get(kind, key) @wrapper.get(kind, key) end |
#init(all_data) ⇒ Object
80 81 82 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 80 def init(all_data) @wrapper.init(all_data) end |
#initialized? ⇒ Boolean
88 89 90 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 88 def initialized? @wrapper.initialized? end |
#monitoring_enabled? ⇒ Boolean
45 46 47 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 45 def monitoring_enabled? true end |
#stop ⇒ Object
92 93 94 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 92 def stop @wrapper.stop end |
#upsert(kind, item) ⇒ Object
84 85 86 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 84 def upsert(kind, item) @wrapper.upsert(kind, item) end |