Class: Moneta::Shared
- Defined in:
- lib/moneta/shared.rb
Overview
Shares a store between processes
Instance Attribute Summary
Attributes inherited from Proxy
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(options = {}, &block) ⇒ Shared
constructor
Constructor.
Methods inherited from Wrapper
#clear, #delete, #increment, #key?, #load, #store
Methods inherited from Proxy
#clear, #delete, #increment, #key?, #load, #store
Methods inherited from Base
#[], #[]=, #fetch, #increment, #key?
Methods included from Mixins::WithOptions
#expires, #prefix, #raw, #with
Constructor Details
#initialize(options = {}, &block) ⇒ Shared
Constructor
Options:
-
:port - TCP port (default 9000)
-
:host - Hostname (default empty)
-
:file - Unix socket file name (default none)
22 23 24 25 |
# File 'lib/moneta/shared.rb', line 22 def initialize( = {}, &block) @options = @builder = Builder.new(&block) end |
Instance Method Details
#close ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/moneta/shared.rb', line 27 def close if @server @server.stop @server = nil end if @adapter @adapter.close @adapter = nil end end |