Module: Cacheflow
- Defined in:
- lib/cacheflow.rb,
lib/cacheflow/redis.rb,
lib/cacheflow/version.rb,
lib/cacheflow/memcached.rb
Defined Under Namespace
Modules: Memcached, Redis, Sidekiq
Constant Summary
collapse
- VERSION =
"0.2.1"
Class Method Summary
collapse
Class Method Details
.activate ⇒ Object
8
9
10
11
|
# File 'lib/cacheflow.rb', line 8
def self.activate
require "cacheflow/memcached" if defined?(Dalli)
require "cacheflow/redis" if defined?(Redis)
end
|
.silence ⇒ Object
17
18
19
20
21
22
23
24
25
|
# File 'lib/cacheflow.rb', line 17
def self.silence
previous_value = silenced?
begin
Thread.current[:cacheflow_silenced] = true
yield
ensure
Thread.current[:cacheflow_silenced] = previous_value
end
end
|
.silence_sidekiq! ⇒ Object
.silenced? ⇒ Boolean
13
14
15
|
# File 'lib/cacheflow.rb', line 13
def self.silenced?
Thread.current[:cacheflow_silenced]
end
|