Class: Rack::Session::RufusTyrant

Inherits:
Abstract::ID
  • Object
show all
Defined in:
lib/rack/session/rufus_tyrant.rb

Constant Summary collapse

DEFAULT_OPTIONS =
Abstract::ID::DEFAULT_OPTIONS.merge :tyrant_server => "localhost:1978"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, options = {}) ⇒ RufusTyrant

Returns a new instance of RufusTyrant.



9
10
11
12
13
14
15
16
17
# File 'lib/rack/session/rufus_tyrant.rb', line 9

def initialize(app, options = {})
  super
  @mutex = Mutex.new
  @host, @port = *(options[:tyrant_server] || @default_options[:tyrant_server]).split(":") # @default_options)        #options[:cache] ||
  # connecting & closing on each get and put
  # not sure if this is the best option, but otherwise it'll keep
  # opening connections until tyrant freezes... =/
   tokyo_connect
end

Instance Attribute Details

#mutexObject (readonly)

Returns the value of attribute mutex.



6
7
8
# File 'lib/rack/session/rufus_tyrant.rb', line 6

def mutex
  @mutex
end

#poolObject (readonly)

Returns the value of attribute pool.



6
7
8
# File 'lib/rack/session/rufus_tyrant.rb', line 6

def pool
  @pool
end