Interface LiveHub
interface LiveHub {
sockets?: boolean;
open(init: LiveOpen): Response | Promise<Response>;
publish(delta: LiveDelta): void | Promise<void>;
revoke(partition: string): void | Promise<void>;
}
sockets?: boolean;
open(init: LiveOpen): Response | Promise<Response>;
publish(delta: LiveDelta): void | Promise<void>;
revoke(partition: string): void | Promise<void>;
}
Where open streams live.
openanswers a streamResponse;publishsends a delta to every open stream;revokesendsrevokedto every stream of a partition and closes it. The in-process memoryHub fits a host that is one long-lived process. A Worker needs a hub every isolate can reach, which is the Durable Object hub in@drupflare/spool/stores/durable-object.socketsis true for a hub that also answers a WebSocket upgrade at the same path; the site's config then tells pages to try a socket first.