Changelog #5

·

Cancel delayed events

Eric Allam

Eric Allam

CTO, Trigger.dev

When sending events, you can delay the delivery by setting either the deliverAt or deliverAfter option:


_10
await 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:


_10
await client.cancelEvent("event-1");

This functionality requires @trigger.dev/[email protected] or later.

Ready to start building?

Build and deploy your first task in 3 minutes.

Get started now
,