Skip to main content

Module live

Module live 

Source
Expand description

What a server can still change once it is serving, and who hears about it.

§Why this is separate from the builder

The builder describes a server before anything is connected to it. This module is the part that outlives that moment: the handler table a request looks up, the registry */list reads, and the sessions that asked to be told when either changes. All three move together, which is why they live behind one Arc and why a ServerHandle is a clone of that Arc rather than a borrow of the Server.

§The ordering that keeps a listing honest

A tool that is listed and not callable is a server telling a peer something false. So an addition installs the handler before it publishes the listing, and a removal withdraws the listing before it drops the handler. In between, a request can find a handler for something not yet listed — harmless, because nobody was told it exists — but never the reverse.

§Why a change is announced after it is published

The notification tells a peer to re-list. A peer that re-lists before the publish lands reads the old set and is never told again, so the announcement follows the publish, and only for kinds the publish actually touched — a removal of something that was never there announces nothing.

Structs§

ListSubscription
A session’s standing interest in list changes, withdrawn on drop.
ServerHandle
A clone-able handle that changes a server while it serves.

Enums§

ListKind
The list notifications a session can ask for.