/** * {@inheritDoc} */ public function watch($tube) { if ($this->dispatcher) { $this->dispatcher->dispatch(CommandEvent::WATCH, new CommandEvent($this, ['tube' => $tube])); } $this->pheanstalk->watch($tube); return $this; }
/** * @param string|string[] $actions */ public function watch($actions) { if (!is_array($actions)) { $actions = [$actions]; } foreach ($actions as $action) { $this->pheanstalk->watch($action); $this->logger->debug(sprintf('Watching tube "%s"', $action)); } }
public function resolveJob($queueName) { $job = $this->pheanstalk->watch($queueName)->reserve(); return $this->serializer->unserialize($job); }