Driver works with Gearman queues.
Configuration example:
return [
'bootstrap' => ['queue'],
'components' => [
'queue' => [
'class' => \zhuravljov\yii\queue\Queue::class,
'driver' => [
'class' => \zhuravljov\yii\queue\gearman\Driver::class,
'host' => 'localhost',
'port' => 4730,
'channel' => 'my_queue',
],
],
],
];
Console is used to process queued tasks.
yii queue/listen
listen
command launches a daemon which infinitely queries the queue. If there are new tasks they're immediately
obtained and executed. This method is most effificient when command is properly daemonized via supervisor such as
supervisord
.