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

    The live streams of every isolate, held by one Durable Object: a page's /.spool/live request is forwarded here and its response is the stream, so a bump or a revocation from any isolate reaches every open page. The object stays in memory while a stream is open and is billed for that duration. One instance serves every stream of a site, which is its ceiling. Bind it as a Durable Object class and pass the namespace to durableObjectHub.

    A WebSocket upgrade is accepted with the Hibernation API when the hub sets hibernate. Those sockets hold no timer, so while no SSE stream is open the object hibernates between a publish, a revoke, a maximum-age alarm and a message that is not a ping.

    Hierarchy

    • DurableObject
      • SpoolLive
    Index
    • Parameters

      • socket: Socket

      Returns void | Promise<void>

    • Parameters

      • request: Request

      Returns Promise<Response>

    • sends revoked to every stream and socket of partition and closes them

      Parameters

      • partition: string

      Returns void

    • Parameters

      • ws: WebSocket
      • code: number

      Returns void

    • Parameters

      • ws: WebSocket
      • message: string | ArrayBuffer

      Returns void

    __DURABLE_OBJECT_BRAND: never
    ctx: DurableObjectState<{}>
    env: Env