Skip to content

Commit ab3b182

Browse files
committed
Reword
1 parent 54df0c4 commit ab3b182

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

workflow.rst

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ order:
368368
* ``workflow.[workflow name].completed``
369369
* ``workflow.[workflow name].completed.[transition name]``
370370

371-
372371
``workflow.announce``
373372
Triggered for each transition that now is accessible for the subject.
374373

@@ -378,7 +377,12 @@ order:
378377
* ``workflow.[workflow name].announce``
379378
* ``workflow.[workflow name].announce.[transition name]``
380379

381-
You can avoid triggering those events by using the context::
380+
After a transition is applied, the announce event tests for all available
381+
transitions. That will trigger all :ref:`guard events <workflow-usage-guard-events>`
382+
once more, which could impact performance if they include intensive CPU or
383+
database workloads.
384+
385+
If you don't need the announce event, disable it using the context::
382386

383387
$workflow->apply($subject, $transitionName, [Workflow::DISABLE_ANNOUNCE_EVENT => true]);
384388

@@ -509,14 +513,6 @@ missing a title::
509513

510514
The optional second argument of ``setBlocked()`` was introduced in Symfony 5.1.
511515

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-
520516
.. _workflow-chosing-events-to-dispatch:
521517

522518
Choosing which Events to Dispatch

0 commit comments

Comments
 (0)