Class: ActiveSupport::Cache::RedisClusterStore
- Inherits:
-
RedisCacheStore
- Object
- RedisCacheStore
- ActiveSupport::Cache::RedisClusterStore
- Defined in:
- lib/active_support/cache/redis_cluster_store.rb
Instance Method Summary collapse
- #delete_matched(matcher, options = nil) ⇒ Object
- #fetch_multi(*names) ⇒ Object
- #increment(key, amount = 1, options = {}) ⇒ Object
Instance Method Details
#delete_matched(matcher, options = nil) ⇒ Object
6 7 8 |
# File 'lib/active_support/cache/redis_cluster_store.rb', line 6 def delete_matched(matcher, = nil) fail ::NotImplementedError, "Deleting keys with a matcher is not supported with redis cluster" end |
#fetch_multi(*names) ⇒ Object
10 11 12 |
# File 'lib/active_support/cache/redis_cluster_store.rb', line 10 def fetch_multi(*names) fail ::NotImplementedError, "The default implementation uses MULTI which isn't supported. This can be changed to use MSET and work." end |
#increment(key, amount = 1, options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/active_support/cache/redis_cluster_store.rb', line 14 def increment(key, amount = 1, = {}) = () ttl = _expires_in() normalized_key = normalize_key(key, ) instrument(:increment, key, :amount => amount) do redis.with do |c| if ttl new_value, _ = c.pipelined do c.incrby normalized_key, amount c.expire normalized_key, ttl end new_value else c.incrby normalized_key, amount end end end end |