Expand description
FRAME-12: the bus — what the host hands every mounted component,
whatever drew it (the rhx runtime, a module written by hand, FRAME-13’s
Svelte): one Bus per page, one Member per mounted component.
call(method, params)— through the page’s one socket, refused before it when the component’susesdoes not name the method; FRAME-37: its stream gathered into oneAnswerbyanswer_sink— what rhx’scall(method, params, "fold")folds and a module’sbus.callresolves;live(spec)— the page’s live collection for that spec (the whole spec: snapshot, params, changes, changes params, key, folds), shared with every other reader of it, rhx or not; its methods held touses; FRAME-19: a module’s (Member::follow) held by itswhenand its param changes coalesced by itsdebounce_ms, as rhx’s are;emit(topic, data)/on(topic, f)— page-wide, topics bare strings matched whole,plexus.the host’s own (a component’s emit under it is refused); a member never hears its own emit;- FRAME-53: a sticky topic —
Member::emit_sticky(and the host’sBus::say_sticky,plexus.booted) keeps the topic’s last event on the bus, one per topic; a later emit on it, sticky or not, replaces it, and it goes when the member that said it leaves (a remount says it again; the host’s own are never cleared).Member::on_lasthears the kept event at once (in the bus’s turn: now, when nothing is under way or held), then asMember::on;Bus::lastanswers it — only what has been delivered. A topic never emitted sticky is kept for no one; navigate(route);slots_set(layout, slot, component, version?)—ui.slots.set, a call like any other, held touses; FRAME-29: a section a mark binds (data-component) is refusedboundbefore it.
Delivery waits its turn. Everything the bus hands out — each
listener’s event, each deferred callback (Bus::defer, a module’s
subscribe) — goes through one queue, first in first out, and is run
only when nothing of the host’s is under way: an emit made inside a
delivery, or inside an rhx fold (Bus::hold around it), is heard
after the one under way has reached every listener. Nothing is
re-entered, so no borrow of the host’s is ever held across a component.
FRAME-36: keys(decls) — a component’s shortcuts into the page’s one
registry (crate::keys::Keys), held until the answer is dropped or
the member leaves.
A member that Member::leaves (its component unmounted or swapped
out) hears nothing more and reaches no one.
Structs§
- Answer
- FRAME-37: a call’s answer, whole, once its stream ended —
okwhen it ended with no in-banderror/refusedevent, no refusal, no failure and no drop;eventsits data events in order (each a map withtype);messagethe error’s, refusal’s or failure’s words (an in-band one’smessage, else itsreason), orDISCONNECTEDfor a drop, when notok. - Bus
- The page’s one bus (a handle: clones are the same bus).
- Hold
Bus::hold’s guard: dropping it lets the queue run.- Listening
- A listener held: dropping it stops it.
- Member
- One mounted component’s side of the bus (a handle).
Enums§
- BusRefusal
- What the bus refuses a member, before anything reaches the socket.
Constants§
- DISCONNECTED
- FRAME-37: what
messagesays when the socket dropped before the answer. - RESERVED
- The prefix of the host’s own topics.
Traits§
- BusHost
- What the bus needs of the host: the socket, the live cache, the router and the live version.
Functions§
- answer_
sink - FRAME-37: a sink that gathers a call’s stream and hands
doneitsAnsweronce, when the stream ends (Done, a refusal, or the socket dropping under it). Nothing here sends anything: a call is sent once.