-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Scheduler] Add new component documentation #18290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
.. code-block:: terminal | ||
|
||
$ php bin/console messenger:consume scheduler_trial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do scheduler_trial
comes from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see this component being documented! 😃
RecurringMessage::every('first day of month', $msg); | ||
RecurringMessage::every('next tuesday', $msg); | ||
|
||
It is possible to specify an exact hour to trigger the schedule with `from` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible to specify an exact hour to trigger the schedule with `from` | |
It is possible to specify an exact hour to trigger the schedule with ``from`` |
$from = new \DateTimeImmutable('13:47', new \DateTimeZone('Europe/Paris')); | ||
RecurringMessage::every('first day of month', $msg, from: $from); | ||
|
||
If your schedule does not need to run indefinitely, you can use the `until` option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If your schedule does not need to run indefinitely, you can use the `until` option | |
If your schedule does not need to run indefinitely, you can use the ``until`` option |
|
||
.. note:: | ||
|
||
The minimal interval allowed with cron is 1 minute. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The minimal interval allowed with cron is 1 minute. | |
The minimal interval allowed by the ``cron()`` method is 1 minute. |
} | ||
} | ||
|
||
Run the Messenger consumer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run the Messenger consumer | |
Run The Messenger Consumer |
|
||
$ php bin/console messenger:consume scheduler_trial | ||
|
||
Trigger your schedule |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trigger your schedule | |
Trigger Your Schedule |
The minimal interval allowed with cron is 1 minute. | ||
|
||
Hashed expressions | ||
~~~~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~~~~ | |
~~~~~~~~~~~~~~~~~~ |
* `#yearly`, `#annually` - Run once a year, midnight, Jan. 1 - `0 0 1 1 *` | ||
* `#monthly` - Run once a month, midnight, first of month - `0 0 1 * *` | ||
* `#weekly` - Run once a week, midnight on Sun - `0 0 * * 0` | ||
* `#daily`, `#midnight` - Run once a day, midnight - `0 0 * * *` | ||
* `#hourly` - Run once an hour, first minute - `0 * * * *` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `#yearly`, `#annually` - Run once a year, midnight, Jan. 1 - `0 0 1 1 *` | |
* `#monthly` - Run once a month, midnight, first of month - `0 0 1 * *` | |
* `#weekly` - Run once a week, midnight on Sun - `0 0 * * 0` | |
* `#daily`, `#midnight` - Run once a day, midnight - `0 0 * * *` | |
* `#hourly` - Run once an hour, first minute - `0 * * * *` | |
* ``#yearly``, ``#annually`` - Run once a year, midnight, Jan. 1 - ``0 0 1 1 *`` | |
* ``#monthly`` - Run once a month, midnight, first of month - ``0 0 1 * *`` | |
* ``#weekly`` - Run once a week, midnight on Sun - ``0 0 * * 0`` | |
* ``#daily``, ``#midnight`` - Run once a day, midnight - ``0 0 * * *`` | |
* ``#hourly`` - Run once an hour, first minute - ``0 * * * *`` |
* `#hourly` - Run once an hour, first minute - `0 * * * *` | ||
|
||
Message generator | ||
~~~~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~~~~ | |
~~~~~~~~~~~~~~~~~ |
|
||
You can also use some another triggers: ``CallbackTrigger, CronExpressionTrigger, DateIntervalTrigger, DatePeriodTrigger, ExcludeTimeTrigger`` | ||
|
||
Define your own trigger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define your own trigger | |
Define Your Own Trigger |
~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
By implementing the TriggerInterface, you can create your own trigger using | ||
``getNextRunDate`` method:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
``getNextRunDate`` method:: | |
the :method:`FQCN\TriggerInterface::getNextRunDate` method:: |
@kbond maybe you can find some spare time and review this PR, so we can merge this as a first version. Thanks |
Please, let's not work on this PR anymore for now. It's not bad 🙏 but we're discussing internally about a radically different approach for the docs of this component. Same comment for the #17964 PR about Webhook/RemoteEvent docs. I'm sorry but I hope you understand this. Thanks! |
@javiereguiluz , please, can you give us more details? I'm so curious! 😋 |
Fixes #18067, #18255, #18251
Based on #18136
Waiting for feedbacks and ready to fix some issues :)