Class EM::Hiredis::PersistentLock
In: lib/em-hiredis/persistent_lock.rb
Parent: Object

A lock that automatically re-acquires a lock before it loses it

The lock is configured with the following two parameters

:lock_timeout - Specifies how long each lock is acquired for. Setting

  this low means that locks need to be re-acquired very often, but a long
  timout means that a process that fails without cleaning up after itself
  (i.e. without releasing it's underlying lock) will block the anther
  process from picking up this lock
  replaced for a long while

:retry_interval - Specifies how frequently to retry acquiring the lock in

  the case that the lock is held by another process, or there's an error
  communicating with redis

Methods

acquire   locked?   new   onlocked   onunlocked   stop  

Public Class methods

Public Instance methods

Acquire the lock (called automatically by initialize)

[Validate]