Wire event and queue handlers for any non-HTTP request scope — queue
batches, scheduled/cron runs, CLI commands, Durable Objects, Workflows,
WorkerEntrypoints — all of which may emit events or dispatch to queues from
arbitrary user code. This is the single source of truth for that wiring:
every non-HTTP entry point routes through it rather than open-coding which
subsystems to init, so a subsystem can't be silently dropped by a future
refactor (the queue half was once lost from the command path that way).
HTTP (fetch) deliberately does NOT use this: a fetch worker only enqueues
to the async Cloudflare queue and never processes consumers inline, so it
skips queue init via initializeRouting.
Wire event and queue handlers for any non-HTTP request scope — queue batches, scheduled/cron runs, CLI commands, Durable Objects, Workflows, WorkerEntrypoints — all of which may emit events or dispatch to queues from arbitrary user code. This is the single source of truth for that wiring: every non-HTTP entry point routes through it rather than open-coding which subsystems to init, so a subsystem can't be silently dropped by a future refactor (the queue half was once lost from the command path that way).
HTTP (
fetch) deliberately does NOT use this: a fetch worker only enqueues to the async Cloudflare queue and never processes consumers inline, so it skips queue init viainitializeRouting.