Skip to content

Commit 885e42d

Browse files
lyrixxOskarStark
authored andcommitted
[Messenger] Document StopWorkerException
1 parent 1bddd35 commit 885e42d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

messenger.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,17 @@ The first argument is the receiver's name (or service id if you routed to a
461461
custom service). By default, the command will run forever: looking for new messages
462462
on your transport and handling them. This command is called your "worker".
463463

464+
.. tip::
465+
466+
To properly stop a worker, throw an instance of
467+
:class:`Symfony\\Component\\Messenger\\Exception\\StopWorkerException`.
468+
469+
.. versionadded:: 5.4
470+
471+
The :class:`Symfony\\Component\\Messenger\\Exception\\StopWorkerException`
472+
class was introduced in Symfony 5.4.
473+
474+
464475
Deploying to Production
465476
~~~~~~~~~~~~~~~~~~~~~~~
466477

0 commit comments

Comments
 (0)