/** * {@inheritDoc} */ public function acknowledge($item) { if (!parent::acknowledge($item)) { return false; } return $this->connection()->deleteMessage($item['queue'], $item['id']); }
/** * {@inheritDoc} */ public function acknowledge($item) { if (!parent::acknowledge($item)) { return false; } return $this->return; }
/** * {@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; }
/** * {@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); }
/** * {@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')]); }