Class EM::Hiredis::Lock
In: lib/em-hiredis/lock.rb
Parent: Object

Cross-process re-entrant lock, backed by redis

Methods

acquire   clear   new   onexpire   to_s   unlock  

Public Class methods

Public Instance methods

Acquire the lock

This is a re-entrant lock, re-acquiring will succeed and extend the timeout

Returns a deferrable which either succeeds if the lock can be acquired, or fails if it cannot.

This should not be used in normal operation. Force clear without regard to who owns the lock.

Register a callback which will be called 1s before the lock expires This is an informational callback, there is no hard guarantee on the timing of its invocation because the callback firing and lock key expiry are handled by different clocks (the client process and redis server respectively)

Release the lock

Returns a deferrable

[Validate]