Class: ActionDispatch::Session::MemCacheStore
- Inherits:
-
AbstractStore
- Object
- AbstractStore
- ActionDispatch::Session::MemCacheStore
- Defined in:
- lib/action_dispatch/middleware/session/mem_cache_store.rb
Constant Summary
Constants inherited from AbstractStore
AbstractStore::DEFAULT_OPTIONS, AbstractStore::ENV_SESSION_KEY, AbstractStore::ENV_SESSION_OPTIONS_KEY
Instance Method Summary collapse
-
#initialize(app, options = {}) ⇒ MemCacheStore
constructor
A new instance of MemCacheStore.
Methods inherited from AbstractStore
Constructor Details
#initialize(app, options = {}) ⇒ MemCacheStore
Returns a new instance of MemCacheStore.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/action_dispatch/middleware/session/mem_cache_store.rb', line 4 def initialize(app, = {}) require 'memcache' # Support old :expires option [:expire_after] ||= [:expires] super @default_options = { :namespace => 'rack:session', :memcache_server => 'localhost:11211' }.merge(@default_options) @pool = [:cache] || MemCache.new(@default_options[:memcache_server], @default_options) unless @pool.servers.any? { |s| s.alive? } raise "#{self} unable to find server during initialization." end @mutex = Mutex.new super end |