Hoodoo::TransientStore plugin for Memcached. The Dalli gem is used for server communication.

Methods
C
D
G
N
S
Attributes
[RW] client

Overrideable access to this object's Dalli::Client instance. It is inadvisable to couple calling code directly into this interface as it is a Hoodoo::TransientStore::Memcached specialisation, but if deemed absolutely necessary the Dalli client can be override with a customised version.

Class Public methods
new( storage_host_uri:, namespace: )

See Hoodoo::TransientStore::Base.new for details.

Do not instantiate this class directly. Use Hoodoo::TransientStore.new.

The Dalli gem is used to talk to Memcached and accepts connection UIRs of simple, terse forms such as 'localhost:11211'. Connections are configured with JSON serialisation, compression off and a forced namespace of nz_co_loyalty_hoodoo_transient_store_ to avoid collision of data stored with this object and other data that may be in the Memcached instance identified by storage_host_uri.

# File lib/hoodoo/transient_store/transient_store/memcached.rb, line 45
def initialize( storage_host_uri:, namespace: )
  super # Pass all arguments through -> *not* 'super()'
  @client = connect_to_memcached( storage_host_uri, namespace )
end
Instance Public methods
close()
# File lib/hoodoo/transient_store/transient_store/memcached.rb, line 72
def close
  @client.close()
end
delete( key: )
# File lib/hoodoo/transient_store/transient_store/memcached.rb, line 65
def delete( key: )
  @client.delete( key )
  true
end
get( key: )
# File lib/hoodoo/transient_store/transient_store/memcached.rb, line 59
def get( key: )
  @client.get( key )
end
set( key:, payload:, maximum_lifespan: )
# File lib/hoodoo/transient_store/transient_store/memcached.rb, line 52
def set( key:, payload:, maximum_lifespan: )
  @client.set( key, payload, maximum_lifespan )
  true
end