Type Alias LiveOpen
first: LiveFrame[];
keepaliveMs: number;
leaseMs: number;
maxAgeMs: number;
partition: string | null;
signal?: AbortSignal;
socket?: boolean;
valid?: () => boolean | Promise<boolean>;
}
Properties
first
events written first, in order: hello and the catch-up delta
keepalive Ms
milliseconds between keepalive comments
lease Ms
how long each lease event grants, in milliseconds; a lease follows first and then every half of it
max Age Ms
the stream closes after this long, so the next connect resolves the identity again; 0 never
partition
the principal partition id the page holds; null for a public stream
Optionalsignal
the request's abort signal; a stream closes when it aborts
Optionalsocket
true when the request is a WebSocket upgrade. A hub with sockets answers it with a socket;
any other hub ignores it and answers the stream, which makes the page fall back to SSE.
Optionalvalid
Called at each lease tick of a partition stream; false ends the session at once with revoked.
A hub that runs in another isolate cannot take a function, so it ignores this and relies on
LiveHub.revoke and maxAgeMs.
what a hub needs to open one stream; everything but
signalandvalidcrosses a Durable Object as JSON