Skip to content

Commit e5c176c

Browse files
kissifrotjaviereguiluz
authored andcommitted
Workflow - Add a note about guards events and ability to save some CPU
1 parent 249434e commit e5c176c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

workflow.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,16 @@ missing a title::
509509

510510
The optional second argument of ``setBlocked()`` was introduced in Symfony 5.1.
511511

512+
.. note::
513+
514+
When using guard listeners which imply intensive workloads (CPU, Database
515+
or longer-running code blocks), if you only want them to be fired when strictly
516+
necessary (only when ``Workflow::can()`` or ``Workflow::apply()`` is executed),
517+
be sure to disable ``Workflow::DISABLE_ANNOUNCE_EVENT`` as indicated in
518+
:ref:`Choosing which Events to Dispatch <workflow-chosing-events-to-dispatch>`
519+
520+
.. _workflow-chosing-events-to-dispatch:
521+
512522
Choosing which Events to Dispatch
513523
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
514524

0 commit comments

Comments
 (0)