What's the best (simplest) way to schedule something to run once at a later time?

There are various ways to accomplish this, but is there a simple feature made just for this? What I’d really like is a way to queue something up, but that only gets dequeued after some datetime, but doesn’t look like queues has that functionality.

The Queues Team is in Discord (https://discord.com/invite/cloudflaredev) and shares updates there, the latest pinned update includes:

  • We’re also working on landing controls around setting message delays - e.g. await env.MY_QUEUE.send(msg, { deliveryDelay: 600 }) on the producer side, and retry delays on the consumer side - e.g. messages.batch.retryAfter(300) or .retryAfter(seconds: number) on a per-message basis. API not final.

Not out yet but they are working on it.

The closest other thing I can think of is probably Durable Object Alarms: Alarms · Cloudflare Durable Objects docs, but they’d require you to use DOs and you can only do one alarm per DO Instance.

2 Likes

That delay on queues is exactly what I’m looking for, thanks for the info. I’ll probably just wait for it…