Class: Rimcache::Config
- Inherits:
-
Object
- Object
- Rimcache::Config
- Defined in:
- lib/rimcache/config.rb
Overview
Configuration for Rimcache
Instance Attribute Summary collapse
-
#check_frequency ⇒ ActiveSupport::Duration
The expiry cache will only be checked if it has not been in this much time.
-
#expiry_cache ⇒ ActiveSupport::Cache::Store
An instance of ActiveSupport::Cache::Store used to coordinate Rimcache expiry and invalidation across processes.
-
#expiry_cache_key ⇒ String | Symbol
The cache key to use in expiry_cache.
-
#refresh_interval ⇒ ActiveSupport::Duration
If this is set, rimcached values will be refreshed after this much time even if they have not been explicitly expired.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
32 33 34 35 |
# File 'lib/rimcache/config.rb', line 32 def initialize @check_frequency = 4.seconds @expiry_cache_key = "rimcache_expiry" end |
Instance Attribute Details
#check_frequency ⇒ ActiveSupport::Duration
The expiry cache will only be checked if it has not been in this much time. A stale cached value can keep being returned for up to this long after another process invalidates it. Defaults to 4 seconds
24 25 26 |
# File 'lib/rimcache/config.rb', line 24 def check_frequency @check_frequency end |
#expiry_cache ⇒ ActiveSupport::Cache::Store
An instance of ActiveSupport::Cache::Store used to coordinate Rimcache expiry and invalidation across processes. If not set, defaults to Rails.cache.
12 13 14 |
# File 'lib/rimcache/config.rb', line 12 def expiry_cache @expiry_cache end |
#expiry_cache_key ⇒ String | Symbol
The cache key to use in expiry_cache. Defaults to “rimcache_expiry” but can be changed to avoid conflicts.
17 18 19 |
# File 'lib/rimcache/config.rb', line 17 def expiry_cache_key @expiry_cache_key end |
#refresh_interval ⇒ ActiveSupport::Duration
If this is set, rimcached values will be refreshed after this much time even if they have not been explicitly expired. Default value is nil
.
30 31 32 |
# File 'lib/rimcache/config.rb', line 30 def refresh_interval @refresh_interval end |