@@ -129,6 +129,27 @@ Scheduling Recurring Messages
129
129
A ``RecurringMessage `` is a message associated with a trigger, which configures
130
130
the frequency of the message. Symfony provides different types of triggers:
131
131
132
+ :class: `Symfony\\ Component\\ Scheduler\\ Trigger\\ CronExpressionTrigger `
133
+ A trigger that uses the same syntax as the `cron command-line utility `_.
134
+
135
+ :class: `Symfony\\ Component\\ Scheduler\\ Trigger\\ CallbackTrigger `
136
+ A trigger that uses a callback to determine the next run date.
137
+
138
+ :class: `Symfony\\ Component\\ Scheduler\\ Trigger\\ ExcludeTimeTrigger `
139
+ A trigger that excludes certain times from a given trigger.
140
+
141
+ :class: `Symfony\\ Component\\ Scheduler\\ Trigger\\ JitterTrigger `
142
+ A trigger that adds a random jitter to a given trigger. The jitter is some
143
+ time that it's added/subtracted to the original triggering date/time. This
144
+ allows to distribute the load of the scheduled tasks instead of running them
145
+ all at the exact same time.
146
+
147
+ :class: `Symfony\\ Component\\ Scheduler\\ Trigger\\ PeriodicalTrigger `
148
+ A trigger that uses a ``DateInterval `` to determine the next run date.
149
+
150
+ Most of them can be created via the :class: `Symfony\\ Component\\ Scheduler\\ RecurringMessage `
151
+ class, as shown in the following examples.
152
+
132
153
Cron Expression Triggers
133
154
~~~~~~~~~~~~~~~~~~~~~~~~
134
155
@@ -139,7 +160,7 @@ It uses the same syntax as the `cron command-line utility`_::
139
160
// optionally you can define the timezone used by the cron expression
140
161
RecurringMessage::cron('* * * * *', new Message(), new \DateTimeZone('Africa/Malabo'));
141
162
142
- Before using it, you must install the following dependency:
163
+ Before using it, you have to install the following dependency:
143
164
144
165
.. code-block :: terminal
145
166
@@ -219,7 +240,7 @@ Then, define your recurring message::
219
240
new SendDailySalesReports('...'),
220
241
);
221
242
222
- Finally, the recurring messages must be attached to a schedule::
243
+ Finally, the recurring messages has to be attached to a schedule::
223
244
224
245
// src/Scheduler/MyScheduleProvider.php
225
246
namespace App\Scheduler;
0 commit comments