DtcQueueBundle icon indicating copy to clipboard operation
DtcQueueBundle copied to clipboard

Daemon mode

Open xYundy opened this issue 4 years ago • 1 comments

There is any way (or maybe it's need to be implemented) to launch worker in daemon mode?

I want to run worker which will works infinite amount of time (if there is no job it will be waiting for job. After job, process will quit. (So I can restart it with supervisord for example)

Something like in Laravel Horizon for example.

In their package I can run master process which control of creating worker pools and they are waiting for tasks.

xYundy avatar Sep 09 '20 12:09 xYundy

Here is a supervisord worker.ini example that runs on loop forever.

The key is setting the autorestart to true.

[program:MyWorkerProcess]
command=/usr/local/bin/php /var/www/bin/console dtc:queue:run --max-count 15 -v -t 3600
autostart=true
autorestart=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true

kgrycuk avatar Jul 06 '21 15:07 kgrycuk