Class: RemoteLock::Adapters::Memcached

Inherits:
Base
  • Object
show all
Defined in:
lib/remote_lock/adapters/memcached.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, valid?

Constructor Details

This class inherits a constructor from RemoteLock::Adapters::Base

Instance Method Details

#delete(key) ⇒ Object



11
12
13
# File 'lib/remote_lock/adapters/memcached.rb', line 11

def delete(key)
  @connection.delete(key)
end

#has_key?(key) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/remote_lock/adapters/memcached.rb', line 15

def has_key?(key)
  @connection.get(key) == uid
end

#store(key, expires_in_seconds) ⇒ Object



6
7
8
9
# File 'lib/remote_lock/adapters/memcached.rb', line 6

def store(key, expires_in_seconds)
  status = @connection.add(key, uid, expires_in_seconds)
  status =~ /^STORED/
end