*/ interface WorkerInterface extends LoggerAwareInterface { /** * @param QueueDispatcherInterface $queueService * @param TaskLogInterface $taskLog * @param bool $handleSignals */ public function __construct(QueueDispatcherInterface $queueService, TaskLogInterface $taskLog, $handleSignals); /** * Start processing tasks from a given queue * * @return void */ public function run(); /** * Process a task * * @param TaskInterface $task * @return string Status of the task after process */ public function processTask(TaskInterface $task); /** * Set the maximum iterations for the worker. If nothing is set, the worker runs infinitely. * @deprecated * * @param int $maxIterations * @return WorkerInterface */ public function setMaxIterations($maxIterations); /** * Sets a queue on which the worker operates exclusively. * * @param QueueInterface $queue * @param int $maxIterations * * @return WorkerInterface */ public function setDedicatedQueue(QueueInterface $queue, $maxIterations = 0); }