interface WorkersMessagingRpcArm
Since 0.2.0

Enables brokered request-reply on a WorkersMessagingArm.

A Cloudflare queue reaches exactly one consumer Worker and never the caller waiting for a reply, so RPC needs a second, addressable path: a Durable Object the caller holds a WebSocket to while its request is in flight. That costs a namespace binding and a DO class the application exports, which is why it is opt-in rather than always on — a project that only publishes and subscribes should not have to deploy one.

The namespace's class_name must be a Durable Object class the application exports, delegating to ReplyInboxObjectCore.

The consuming queue must set max_batch_timeout = 0 in wrangler.toml. The platform default is 5 seconds, which alone exhausts the default reply budget, so every request() would time out.

Properties

readonly
binding: string

The Durable Object namespace binding name from wrangler.toml.

readonly
optional
defaultTimeoutMs: number

Reply budget applied when RequestOptions.timeoutMs is omitted.

Usage

import { type WorkersMessagingRpcArm } from "cloudflare-plugin/src/index.ts";