Changelog #5
·
Cancel delayed events
CTO, Trigger.dev
When sending events, you can delay the delivery by setting either the deliverAt
or deliverAfter
option:
_10await client.sendEvent(_10 {_10 id: "event-1",_10 name: "example.event",_10 payload: { hello: "world" },_10 },_10 {_10 deliverAfter: 1000 * 60 * 60 * 24, // 1 day_10 }_10);
You can now easily cancel delayed events to prevent subsequent job runs with the new cancelEvent
method:
_10await client.cancelEvent("event-1");
This functionality requires @trigger.dev/[email protected]
or later.