The Queues producer binding
Unique id source; pass IRuntimeServices
Optionaloptions: WorkersQueueOptions
Logger and delay cap
Enqueues a job.
The returned id is generated here rather than by the platform, because
producer.send() resolves to void. It travels inside the message
envelope, so the id this returns is the id the processor sees as
job.id.
The payload type
Job name; a processor must be registered under it to consume
Job payload, serialized as JSON by the platform
Optionaloptions: AddJobOptions
delayMs (converted to whole seconds, rounded up) and
maxAttempts (enforced at dispatch, since Cloudflare's max_retries is
queue-wide configuration rather than per message)
The job id
Not supported on Cloudflare Queues.
The payload type
Job name
Ignored
The cron expression that cannot be honored here
Never resolves
Dispatches one delivered batch into the registered processors.
Every message is acked or retried exactly once:
retry(), because a message the
consumer cannot route is a configuration problem and acking would discard
it permanently and silently;retry(), same reason;attempts past the envelope's maxAttempts → ack() without running
the processor, since the caller asked for the job to stop;retry(), leaving the queue's own
max_retries and dead-letter configuration to decide what happens next;ack().The delivered batch
Resolves once every message has been acked or retried
Registers a processor for a job name.
Registering twice under one name replaces the earlier processor, matching
QueueService.process in queue-plugin so the committed port behaves the
same way on every backend.
The payload type
Job name
Invoked per delivered job
Optionaloptions: ProcessOptions
concurrency bounds how many of one batch's messages for
this name run at a time
A background job queue backed by Cloudflare Queues.
Two of the three committed methods map onto the platform directly.
addRecurringdoes not and throws: Cloudflare has no recurring queue message, and the platform's answer — Cron Triggers — is a different mechanism with its own handler export, reached throughWorkersCron.Consuming requires the application to export the handler
createQueueHandlerbuilds:Example
Since
0.2.0