drift Docs
Start
What is Drift?
The tour, if you are new here.
Use cases
Whether Drift does your thing.
Getting started
Nothing to deployed, in one command.
Architecture
How a slice is put together.
What it costs
The free grant, four unit prices, two rules.
Build
Canvas
Static sites, same origin as your API.
Tools
Operate
Auth
Route gates, API keys and your account.
Security
Boundaries, sandboxing and hardening.
Troubleshooting
Error codes
What went wrong, and what to do about it.
Legal
Acceptable use
What a slice may not be used for.
Data processing
The DPA, and every sub-processor.

Queues

drift.Backbone.Queue(name): FIFO message queues.

Signatures

Go
// Pop takes the next message destructively
Push(body any) error   ·   Pop() (json.RawMessage, error)

A message body must be a JSON object. A bare string, number or array is rejected with 400 queue and body required, and a push past the queue's depth answers 429.

Push-based or pull-based, not both

Pop is the pull consumer, for a function that drains a queue on its own schedule. The push path is a function the Driftfile names queue:<name>, which the platform invokes once per message. Use one or the other on a given queue.

A worker receives the inner body, not the envelope.

A queue-triggered function is handed the payload, not the {id, body, timestamp} envelope that Pop and the CLI's peek return. Read your own fields straight off the payload.

On a deployed slice, a queue exists only once something has pushed to it.

Pop on a name nothing has ever pushed to answers 404, which every SDK surfaces as an error. Pop on a queue that has held a message before, even if it is empty now, answers cleanly with nothing, no error at all. Locally there is no such distinction: every empty Pop is quiet regardless of whether the name has been used before. Push once, or otherwise be ready for that first error, before a worker's very first Pop on a fresh deploy.

A failed invocation is requeued with a retry counter; after three attempts the message moves to <queue>-dlq, an ordinary queue you can drain like any other. The Atomic guide has the poll interval and what counts as a failure.