Scheduled events allow you to raise an event at a point in time or on a recurring schedule. Scheduled events function like a raised event with a few restrictions.
...
and are scheduled for the current pico
...
Table of Contents | ||||
---|---|---|---|---|
|
...
schedule:list()
Returns an array of scheduled eventsevents schedule by the ruleset it is executed in. For example:
Code Block | ||||
---|---|---|---|---|
| ||||
[ { id: "cj2j53ckp0000vgdx7p8rxw0o", at: "2017-12-25T00:00:00.000Z", event: {domain: "holiday", type: "christmas", attrs: {}} }, { id: "cj2j54lc90001vgdxsdhr3kgn", at: "2018-01-01T00:00:00.000Z", event: {domain: "holiday", type: "new-years-day", attrs: {}} }, { id: "cj2j54qpc0002vgdxdbqe2cwj", timespec: "*/1 * * * * *", event: {domain: "every", type: "1second", attrs: {}} } ] |
...
It accepts an id for a scheduled event. This id could come from event:list_scheduled()
or from the postlude. It removes the scheduled event from the queue. If it fails it will throw an error. A ruleset can only remove an event that it scheduled.
Code Block | ||||
---|---|---|---|---|
| ||||
schedule:remove("cj2j54qpc0002vgdxdbqe2cwj"); |
...