Class: ActionDispatch::Session::AerospikeStore

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

Constant Summary collapse

AEROSPIKE_DEFAULT_OPTIONS =
{
    :host => '127.0.0.1',
    :port => 3000,
    :ns   => 'test',
    :set  => 'session',
    :bin  => 'data'
}

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of AerospikeStore.



17
18
19
20
21
22
# File 'lib/action_dispatch/middleware/session/aerospike_store.rb', line 17

def initialize(app, options = {})
  options.merge!(self.class::AEROSPIKE_DEFAULT_OPTIONS) { |key, v1| v1 }
  @client = options.delete(:client) ||
      Aerospike::Client.new(Aerospike::Host.new(options.delete(:host), options.delete(:port)))
  super
end