Skip to content
@drupflare/spool v1.0.0 GitHub
    Preparing search index...

    Interface LiveHub

    Where open streams live. open answers a stream Response; publish sends a delta to every open stream; revoke sends revoked to 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. sockets is 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.

    interface LiveHub {
        sockets?: boolean;
        open(init: LiveOpen): Response | Promise<Response>;
        publish(delta: LiveDelta): void | Promise<void>;
        revoke(partition: string): void | Promise<void>;
    }
    Index
    • Parameters

      • partition: string

      Returns void | Promise<void>

    sockets?: boolean