Class: Moneta::Shared
Overview
Shares a store between processes
Instance Attribute Summary
Attributes inherited from Proxy
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(options = {}, &block) ⇒ Shared
constructor
A new instance of Shared.
-
#server? ⇒ Boolean
Returns true if this wrapper is running as the server.
Methods inherited from Wrapper
#clear, #create, #delete, #each_key, #features, #fetch_values, #increment, #key?, #load, #merge!, #slice, #store, #values_at
Methods inherited from Proxy
#clear, #create, #delete, #each_key, #features, features_mask, #fetch_values, #increment, #key?, #load, #merge!, not_supports, #slice, #store, #values_at
Methods included from Defaults
#[], #[]=, #create, #decrement, #each_key, #features, #fetch, #fetch_values, included, #increment, #key?, #merge!, #slice, #supports?, #update, #values_at
Methods included from OptionSupport
#expires, #prefix, #raw, #with
Constructor Details
Instance Method Details
#close ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/moneta/shared.rb', line 25 def close if server? @server.stop @thread.join @server = @thread = nil end if @adapter @adapter.close @adapter = nil end end |
#server? ⇒ Boolean
Returns true if this wrapper is running as the server
40 41 42 |
# File 'lib/moneta/shared.rb', line 40 def server? @server != nil end |