Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/manual/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,14 @@ does not. See the
[*`WorkersD1KvStore`*](./kv.md#workersd1kvstore-cloudflare-workers-only)
section for details.

> [!WARNING]
> Do not use `InProcessMessageQueue` on Cloudflare Workers. A delayed
> enqueue depends on `setTimeout()`, which may never run after the isolate
> exits, and `listen()` polls memory that is not guaranteed to survive or
> be shared across requests. Use `WorkersMessageQueue` and a `queue()`
> handler, as shown in [Manual queue processing](#manual-queue-processing),
> or configure another durable queue.

#### Node.js compatibility

Fedify depends on Node.js APIs for cryptography and DNS, so Workers need
Expand Down
11 changes: 11 additions & 0 deletions docs/manual/mq.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ Cons
: Not suitable for production, doesn't persist messages between restarts,
no native retry mechanism.

> [!WARNING]
> `InProcessMessageQueue` cannot run on [Cloudflare Workers]. A delayed
> `enqueue()` schedules a `setTimeout()` and resolves immediately, but a
> Worker isolate can terminate after the response, so the timer may never
> run and the message may never enter the queue. `listen()` only polls
> in-memory state, which is not guaranteed to survive or be shared across
> requests. Use
> [`WorkersMessageQueue`](#workersmessagequeue-cloudflare-workers-only) with
> a `queue()` handler, or another durable queue. Do not treat a delayed
> enqueue as reliable on Workers.

~~~~ typescript twoslash
import type { KvStore } from "@fedify/fedify";
// ---cut-before---
Expand Down