Skip to content

Commit 7da0fe3

Browse files
authored
Add some pointers regarding worker processes deployment
It took me quite some effort to figure this out... https://stackoverflow.com/questions/79257466/how-does-symfony-scheduler-component-get-triggered/79257514 It's one of those things that are obvious _after_ you know them, and where you should be looking for them, but not before... I think the specific mentions of "cron" in the text are valuable (because people will search for it), even though it's not the wisest option (when compared to supervisor etc). The link will take them to the best-practices.
1 parent daa6ed1 commit 7da0fe3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scheduler.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,14 @@ the Messenger component:
785785
.. image:: /_images/components/scheduler/generate_consume.png
786786
:alt: Symfony Scheduler - generate and consume
787787

788+
.. tip::
789+
790+
Depending on your deployment scenario, instead of manually executing this
791+
Messenger worker process, you might want to run it with cron, supervisor or systemd,
792+
and ensure workers are running at all times. Check out the `deploying to production`_
793+
section of the Messenger component documentation.
794+
795+
788796
Creating a Consumer Programmatically
789797
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
790798

@@ -970,6 +978,7 @@ When using the ``RedispatchMessage``, Symfony will attach a
970978
helping you identify those messages when needed.
971979

972980
.. _`MakerBundle`: https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html
981+
.. _`deploying to production`: https://symfony.com/doc/current/messenger.html#deploying-to-production
973982
.. _`Memoizing`: https://en.wikipedia.org/wiki/Memoization
974983
.. _`cron command-line utility`: https://en.wikipedia.org/wiki/Cron
975984
.. _`crontab.guru website`: https://crontab.guru/

0 commit comments

Comments
 (0)