Class: Moneta::Pool
Overview
Creates a pool of stores. Each thread gets its own store.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(options = {}, &block) ⇒ Pool
constructor
A new instance of Pool.
Methods inherited from Wrapper
#clear, #create, #delete, #features, #increment, #key?, #load, #store
Methods inherited from Proxy
#clear, #create, #delete, #features, #increment, #key?, #load, #store
Methods included from Defaults
#[], #[]=, #create, #decrement, #features, #fetch, included, #increment, #key?, #supports?
Methods included from OptionSupport
#expires, #prefix, #raw, #with
Constructor Details
Instance Method Details
#close ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/moneta/pool.rb', line 28 def close @mutex.synchronize do raise '#close can only be called when no thread is using the pool' if @all.size != @pool.size @all.each(&:close) @all = @pool = nil end end |