Skip to content

Commit cc72532

Browse files
committed
Merge branch '6.4' into 7.0
* 6.4: [Scheduler] Add `AbstractDecoratedTrigger`
2 parents 7f19f00 + b3b4c34 commit cc72532

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

scheduler.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,25 @@ the frequency of the message. Symfony provides different types of triggers:
147147
:class:`Symfony\\Component\\Scheduler\\Trigger\\PeriodicalTrigger`
148148
A trigger that uses a ``DateInterval`` to determine the next run date.
149149

150+
The :class:`Symfony\\Component\\Scheduler\\Trigger\\JitterTrigger` and
151+
:class:`Symfony\\Component\\Scheduler\\Trigger\\ExcludeTimeTrigger` are decorators
152+
and modify the behavior of the trigger they wrap. You can get the decorated
153+
trigger as well as the decorators by calling the
154+
:method:`Symfony\\Component\\Scheduler\\Trigger\\AbstractDecoratedTrigger::inner`
155+
and :method:`Symfony\\Component\\Scheduler\\Trigger\\AbstractDecoratedTrigger::decorators`
156+
methods::
157+
158+
$trigger = new ExcludeTimeTrigger(new JitterTrigger(CronExpressionTrigger::fromSpec('#midnight', new MyMessage()));
159+
160+
$trigger->inner(); // CronExpressionTrigger
161+
$trigger->decorators(); // [ExcludeTimeTrigger, JitterTrigger]
162+
163+
.. versionadded:: 6.4
164+
165+
The :method:`Symfony\\Component\\Scheduler\\Trigger\\AbstractDecoratedTrigger::inner`
166+
and :method:`Symfony\\Component\\Scheduler\\Trigger\\AbstractDecoratedTrigger::decorators`
167+
methods were introduced in Symfony 6.4.
168+
150169
Most of them can be created via the :class:`Symfony\\Component\\Scheduler\\RecurringMessage`
151170
class, as shown in the following examples.
152171

0 commit comments

Comments
 (0)