- /**
- * I want to do this task and I need to do it myself.
- *
- * @return Locked/Error
- */
- abstract function acquireForMe();
-
- /**
- * I want to do this task, but if anyone else does it
- * instead, it's also fine for me. I will read its cached data.
- *
- * @return Locked/Done/Error
- */
- abstract function acquireForAnyone();
-
- /**
- * I have successfully finished my task.
- * Lets another one grab the lock, and returns the workers
- * waiting on acquireForAnyone()
- *
- * @return Released/NotLocked/Error
- */
- abstract function release();
+ /** @var string All workers with the same key share the lock */
+ protected $key;
+ /** @var integer Maximum number of workers doing the task simultaneously */
+ protected $workers;
+ /** @var integer If this number of workers are already working/waiting, fail instead of wait */
+ protected $maxqueue;
+ /** @var float Maximum time in seconds to wait for the lock */
+ protected $timeout;