Skip to main content

Module session

Module session 

Source
Expand description

The registry an engine keeps its sessions in.

Session lifecycle travels on a [SessionId] channel of its own, separate from the requests that run under those sessions, and the SDK guarantees only that it announces a session before handing out the handle that uses it. A request can therefore reach an engine before the event registering its session has been applied.

That makes a lookup which finds nothing ambiguous: the session may be one whose registration has not been applied yet, which is worth waiting for, or one that has ended, which is not. Waiting on the second never returns, so the registry remembers which sessions it has seen end, and answers for them rather than parking a request on a registration that has already come and gone.

The payload is whatever the engine establishes for a session: the embedded engine publishes the state it keeps locally, and the gRPC engine publishes the identity the server minted for it.

Structs§

SessionEntry
One session’s payload, and the signal that it has been established.
SessionRegistry
The sessions an engine is serving, keyed by the id the SDK gave them.

Type Aliases§

Established
How a session turned out: the payload the engine established for it, or why it never was.