acquire_key() public method

Time of waiting is defined in max_wait_unlock constant of MemoryObject class.
public acquire_key ( string $key, &$auto_unlocker ) : boolean
$key string
$auto_unlocker
return boolean
Example #1
0
 public function getNextError()
 {
     if ($this->storage->acquire_key($this->cache_key, $auto_unlocker)) {
         $messages = $this->storage->read($this->cache_key);
         if (empty($messages)) {
             return false;
         }
         if (!is_array($messages)) {
             $this->FlushLog();
             return $messages;
         }
         $message = array_shift($messages);
         $this->storage->save($this->cache_key, $messages, $this->log_ttl);
         return $message;
     }
     return false;
 }