Class: ActionDispatch::Session::LibmemcachedStore

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of LibmemcachedStore.



8
9
10
11
12
13
14
15
# File 'lib/action_dispatch/session/libmemcached_store.rb', line 8

def initialize(app, options = {})
  options[:expire_after] ||= options[:expires]
  super
  client_options = { default_ttl: options.fetch(:expire_after, 0) }
  client_options[:prefix_key] = options[:prefix_key] || options[:namespace] || 'rack:session'
  @mutex = Mutex.new
  @pool = options[:cache] || Memcached.new(@default_options[:memcache_server], client_options)
end