Situation
Currently I'm using scheduler as separate service in my docker compose setup. All my scheduled tasks are send to the message queue. Consuming the messages is also done in a separate service.
# docker-compose.yml
version: '3.9'
services:
phpfpm:
extends:
file: common-services.yml
service: php-base
restart: always
messenger:
extends:
file: common-services.yml
service: php-base
depends_on:
- rabbitmq
restart: 'no'
command: bin/console messenger:consume -vv async
schedule:
extends:
file: common-services.yml
service: php-base
depends_on:
- rabbitmq
restart: 'no'
command: bin/console scheduler:consume --wait --force -vv
Messenger has a command called messenger:stop-workers, which will gracefully stop workers by completing the currently handled messages and then stops further consuming. This is nice as I can send this command to the messenger container, poll the status of the container for status exited, and know it has completely stopped (and continue with deployment) without the actual need of stopping the container using docker compose stop.
Now for the schedule service, I'm running the consume command with --wait --force, which keeps the container alive and waits for new tasks to be handled (similar kind of behavior as the messenger service). Currently, as there is no native command for scheduler to stop (like at messenger), I am forced to stop the container directly.
Question
Thinking about the above, I got the following questions:
Originally posted by @ToshY in #294
Situation
Currently I'm using scheduler as separate service in my docker compose setup. All my scheduled tasks are send to the message queue. Consuming the messages is also done in a separate service.
Messenger has a command called
messenger:stop-workers, which will gracefully stop workers by completing the currently handled messages and then stops further consuming. This is nice as I can send this command to themessengercontainer, poll the status of the container for statusexited, and know it has completely stopped (and continue with deployment) without the actual need of stopping the container usingdocker compose stop.Now for the
scheduleservice, I'm running the consume command with--wait --force, which keeps the container alive and waits for new tasks to be handled (similar kind of behavior as themessengerservice). Currently, as there is no native command for scheduler to stop (like at messenger), I am forced to stop the container directly.Question
Thinking about the above, I got the following questions:
Originally posted by @ToshY in #294