Did you solve this?
Nov 9, 2016
5
Level 2
Running Laravel Queue standalone (5.4)
I'm trying to run Laravel Queue standalone, and I've been following the guide here: http://masnun.com/2015/05/24/using-laravel-queues-standalone-outside-laravel.html - although I'm implementing a Redis-backed queue.
This guide wasn't quite up to date with the latest changes, so I had to modify my code.
namespace Craft;
use Illuminate\Encryption\Encrypter;
use Illuminate\Queue\Capsule\Manager as Queue;
use Illuminate\Queue\Worker;
use Illuminate\Queue\WorkerOptions;
class QueueCommand extends BaseCommand
{
public function actionWork ()
{
$queue = new Queue;
$queue->getContainer()->bind('encrypter', function () {
return new Encrypter('foobar');
});
$queue->addConnection([
'driver' => 'redis',
'host' => 'localhost',
'queue' => 'default',
], 'default');
$dispatcher = new \Illuminate\Events\Dispatcher();
$exceptionHandler = new ElasticSearch_ExceptionHandler();
$worker = new Worker($queue->getQueueManager(), $dispatcher, $exceptionHandler);
// Run indefinitely
$options = new WorkerOptions([ 0, 128, 60, 2, 3 ]);
$worker->daemon('default', 'default', $options);
}
}
This is what I currently got, and it gives me the following error:
Stack trace:
#0 /vendor/illuminate/queue/Worker.php(119): Illuminate\Queue\QueueManager->isDownForMaintenance()
#1 /vendor/illuminate/queue/Worker.php(75): Illuminate\Queue\Worker->daemonShouldRun()
#2 /consolecommands/QueueCommand.php(69): Illuminate\Queue\Worker->daemon('default', 'default', Object(Illuminate\Queue\WorkerOptions))```
Please or to participate in this conversation.