interface IDurableObjectState
Since 0.2.0

The DurableObjectState (ctx) members this package calls.

Properties

Durable, transactional key/value storage scoped to this object.

Methods

Accepts a socket as hibernatable.

Unlike ws.accept(), this tells the runtime it need not pin the Durable Object to memory while the connection is open: the object may be evicted and its constructor re-run when the next message arrives. That is why RealtimeBackplaneObjectCore keeps no membership in a field — getWebSockets is the only state that survives.

Returns every currently connected socket.

Survives hibernation, which is what makes it usable as the sole source of truth for broadcast membership.

Usage

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