What an HTTP stream is held against (packages/server http/sse.ts): the sign-in behind the
connection. The library declares the mechanism; the registry is the server's (its
LiveStreamRegistry). The pinned key keeps the table entry the server already published —
a hot update from an earlier build compares revocations under the same name.
API
@Interface("@prismshadow/penguin-server#LiveStreams")
export abstract class LiveStreams {
abstract add(userId: string, end: () => void): () => void;
abstract endForUser(userId: string): number;
abstract countFor(userId: string): number;
}Contract Topology
Static AST wiring across @Module / @Provide / @UseMembers (3)
add
add(userId: string, end: () => void): () => voidTrack a live stream for userId. The returned call removes it again and must run on
every exit path of the connection — an entry left behind names a stream nobody can
close, and its end would be called on a connection that is already gone.
@paramuserId
string@paramend
() => void@returns
() => voidendForUser
endForUser(userId: string): numberEnd every stream this user is holding open; returns how many were ended.
@paramuserId
string@returns
numbercountFor
countFor(userId: string): numberHow many streams this user is holding open.
@paramuserId
string@returns
number