示例#1
0
 /**
  * {@inheritDoc}
  */
 public function acknowledge($item)
 {
     if (!parent::acknowledge($item)) {
         return false;
     }
     return $this->connection()->deleteMessage($item['queue'], $item['id']);
 }
示例#2
0
 /**
  * {@inheritDoc}
  */
 public function acknowledge($item)
 {
     if (!parent::acknowledge($item)) {
         return false;
     }
     return $this->return;
 }
示例#3
0
 /**
  * {@inheritDoc}
  */
 public function acknowledge($item)
 {
     if (!parent::acknowledge($item)) {
         return false;
     }
     $sql = sprintf('DELETE FROM `%s` WHERE id = ?', $this->config('table'));
     $sth = $this->connection()->prepare($sql);
     $sth->bindParam(1, $item['id'], PDO::PARAM_INT);
     $sth->execute();
     return $sth->rowCount() == 1;
 }
 /**
  * {@inheritDoc}
  */
 public function acknowledge($item)
 {
     if (!parent::acknowledge($item)) {
         return false;
     }
     if (empty($item['job'])) {
         return false;
     }
     $response = $this->connection()->deleteJob($item['job']);
     return $response->getResponseName() == Response::RESPONSE_DELETED;
 }
示例#5
0
 /**
  * {@inheritDoc}
  */
 public function acknowledge($item)
 {
     if (!parent::acknowledge($item)) {
         return false;
     }
     $script = $this->getRemoveScript();
     $exists = $this->ensureRemoveScript();
     if (!$exists) {
         return false;
     }
     return (bool) $this->connection()->evalSha(sha1($script), [$item['queue'], rand(), $item['id']], 3);
 }
示例#6
0
 /**
  * {@inheritDoc}
  */
 public function acknowledge($item)
 {
     if (!parent::acknowledge($item)) {
         return false;
     }
     $script = $this->getRemoveScript();
     $exists = $this->ensureRemoveScript();
     if (!$exists) {
         return false;
     }
     return $this->evalSha(sha1($script), $item);
 }
 /**
  * {@inheritDoc}
  */
 public function acknowledge($item)
 {
     if (!parent::acknowledge($item)) {
         return false;
     }
     $queue = $item['queue'];
     if (!isset($this->queues[$queue])) {
         return false;
     }
     $deleted = false;
     foreach ($this->queues[$queue] as $i => $queueItem) {
         if ($queueItem['id'] === $item['id']) {
             unset($this->queues[$queue][$i]);
             $deleted = true;
             break;
         }
     }
     return $deleted;
 }
 /**
  * Retrieves a queue worker
  *
  * @param \josegonzalez\Queuesadilla\Engine\Base $engine engine to run
  * @param \Psr\Log\LoggerInterface $logger logger
  * @return \josegonzalez\Queuesadilla\Worker\Base
  */
 public function getWorker($engine, $logger)
 {
     $worker = $this->params['worker'];
     $WorkerClass = "josegonzalez\\Queuesadilla\\Worker\\" . $worker . "Worker";
     return new $WorkerClass($engine, $logger, ['queue' => $engine->config('queue')]);
 }