Skip to main content

Module queue_consumers

Module queue_consumers 

Source
Expand description

One consumer Worker per queue, across the whole project (#3644).

Cloudflare Queues accept a single consumer Worker for each queue, so two contexts consuming one queue could never both deploy: the second wrangler deploy fails. bynk.queue.duplicate_consumer already refuses two handlers for a queue inside one context; this is the same rule across contexts, grouped or not (members of a [deploy.workers] group are one Worker, and also have one consumer for a queue, so a group needs no check of its own). Like bynk.email.duplicate_address, which it is modelled on, it reports only a claim by a different context, on the later one (contexts in name order, so the report does not depend on discovery order).

It runs on every target, like the email check: from queue is a Cloudflare Queues binding, which has one consumer per queue wherever the project is built, and a project that names one queue from two contexts has no single consumer to deploy. That is deliberate, not a Workers-only rule.

Functionsยง

phase_duplicate_queue_consumers
Refuse a queue that two different contexts consume.