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
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
- #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.
41 42 43 44 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 41 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.
65 66 67 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 65 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.
58 59 60 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 58 def self.default_redis_url LaunchDarkly::Integrations::Redis::default_redis_url end |
Instance Method Details
#all(kind) ⇒ Object
73 74 75 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 73 def all(kind) @wrapper.all(kind) end |
#available? ⇒ Boolean
50 51 52 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 50 def available? @wrapper.available? end |
#delete(kind, key, version) ⇒ Object
77 78 79 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 77 def delete(kind, key, version) @wrapper.delete(kind, key, version) end |
#get(kind, key) ⇒ Object
69 70 71 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 69 def get(kind, key) @wrapper.get(kind, key) end |
#init(all_data) ⇒ Object
81 82 83 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 81 def init(all_data) @wrapper.init(all_data) end |
#initialized? ⇒ Boolean
89 90 91 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 89 def initialized? @wrapper.initialized? end |
#monitoring_enabled? ⇒ Boolean
46 47 48 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 46 def monitoring_enabled? true end |
#stop ⇒ Object
93 94 95 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 93 def stop @wrapper.stop end |
#upsert(kind, item) ⇒ Object
85 86 87 |
# File 'lib/ldclient-rb/impl/integrations/redis_impl.rb', line 85 def upsert(kind, item) @wrapper.upsert(kind, item) end |