@@ -133,14 +133,34 @@ Scheduling Recurring Messages
133
133
A ``RecurringMessage `` is a message associated with a trigger, which configures
134
134
the frequency of the message. Symfony provides different types of triggers:
135
135
136
+ :class: `Symfony\\ Component\\ Scheduler\\ Trigger\\ CronExpressionTrigger `
137
+ A trigger that uses the same syntax as the `cron command-line utility `_.
138
+
139
+ :class: `Symfony\\ Component\\ Scheduler\\ Trigger\\ CallbackTrigger `
140
+ A trigger that uses a callback to determine the next run date.
141
+
142
+ :class: `Symfony\\ Component\\ Scheduler\\ Trigger\\ ExcludeTimeTrigger `
143
+ A trigger that excludes certain times from a given trigger.
144
+
145
+ :class: `Symfony\\ Component\\ Scheduler\\ Trigger\\ JitterTrigger `
146
+ A trigger that adds a random jitter to a given trigger. This allows to
147
+ distribute the load of the scheduled tasks instead of running them all
148
+ at the same time.
149
+
150
+ :class: `Symfony\\ Component\\ Scheduler\\ Trigger\\ PeriodicalTrigger `
151
+ A trigger that uses a ``DateInterval `` to determine the next run date.
152
+
153
+ Most of them can be created via the :class: `Symfony\\ Component\\ Scheduler\\ RecurringMessage `
154
+ class, as we'll see in the following examples.
155
+
136
156
Cron Expression Triggers
137
157
~~~~~~~~~~~~~~~~~~~~~~~~
138
158
139
159
It uses the same syntax as the `cron command-line utility `_::
140
160
141
161
RecurringMessage::cron('* * * * *', new Message());
142
162
143
- Before using it, you must install the following dependency:
163
+ Before using it, you have to install the following dependency:
144
164
145
165
.. code-block :: terminal
146
166
@@ -224,7 +244,7 @@ Then, define your recurring message::
224
244
new SendDailySalesReports('...'),
225
245
);
226
246
227
- Finally, the recurring messages must be attached to a schedule::
247
+ Finally, the recurring messages has to be attached to a schedule::
228
248
229
249
// src/Scheduler/MyScheduleProvider.php
230
250
namespace App\Scheduler;
0 commit comments