Class: ActionDispatch::Session::DalliStore

Inherits:
AbstractStore
  • Object
show all
Defined in:
lib/action_dispatch/middleware/session/dalli_store.rb

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of DalliStore.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/action_dispatch/middleware/session/dalli_store.rb', line 9

def initialize(app, options = {})
  # Support old :expires option
  options[:expire_after] ||= options[:expires]

  super

  @default_options = {
    :namespace => 'rack:session',
    :memcache_server => 'localhost:11211',
  }.merge(@default_options)

  @pool = options[:cache] || begin
    Dalli::Client.new( 
        @default_options[:memcache_server], @default_options)
  end
  @namespace = @default_options[:namespace]

  super
end

Instance Method Details

#resetObject



29
30
31
# File 'lib/action_dispatch/middleware/session/dalli_store.rb', line 29

def reset
  @pool.reset
end