Zum Inhalt springen
Deutsch

GrpcStreamHandle

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

GrpcStreamHandle = object

Defined in: src/io/broker/GrpcClientActor.ts:63

Write capability for a stream the caller drives.

Two fields, two jobs. streamId is the correlation id: it is what this stream’s stream-data / stream-end / stream-error frames carry, so one collector can multiplex several concurrent streams. token is the capability: clientStreamSend / clientStreamClose find the stream by token, never by id.

The split matters because a tell carries no verified sender. A sequential id doubles as an address — knowing one hands you the next — so an id alone would let anything that can reach the client actor write into, or close, a stream it never opened. Sixty-four bits of crypto.getRandomValues cannot be guessed, which makes the map lookup itself the ownership check: a wrong token simply finds nothing.

readonly streamId: number

Defined in: src/io/broker/GrpcClientActor.ts:64


readonly token: string

Defined in: src/io/broker/GrpcClientActor.ts:65