/**
* Run the worker instance.
*
* @param string $connection
* @param string $queue
* @param int $delay
* @param int $memory
* @param bool $daemon
* @return array
*/
protected function runWorker($connection, $queue, $delay, $memory, $daemon = false)
{
if ($daemon) {
$this->worker->setCache($this->laravel['cache']->driver());
$this->worker->setDaemonExceptionHandler($this->laravel['Illuminate\\Contracts\\Debug\\ExceptionHandler']);
return $this->worker->daemon($connection, $queue, $delay, $memory, $this->option('sleep'), $this->option('tries'));
}
return $this->worker->pop($connection, $queue, $delay, $this->option('sleep'), $this->option('tries'));
}