Skip to main content

Module delivery_status

Module delivery_status 

Source
Expand description

Whether cloud (MuxBus) messages are reaching this channel’s agents, made visible: a sign-in that stops working, or a relay that can’t be reached, used to leave nothing but a log line while agents silently stopped getting review, CI and cross-machine messages.

State (muxbus.status’s delivery, and the muxbus:status event on every change) is derived in machine::derive from two things only: what the cloud subscriber’s loop last reported (set_link, saw_session) and the credential broker’s state for the sign-in. It never reads the credential store itself.

What follows from it (machine::Effect):

  • one OS notification when a needs-sign-in episode starts (the notify Router’s CloudSignedOut kind), taken down when it ends;
  • after machine::PAUSE_NOTICE_MS paused, one AgentMux system note to every agent subscribed to the cloud, and one more when delivery resumes, with what was delivered and what expired meanwhile (notes). The notes are delivered locally by srv, never through the relay; see notes::NOTE_MARKER for why one can’t be forged.

Re-exports§

Modules§

machine 🔒
The pure half of super: what state cloud delivery is in, given what the cloud subscriber and the credential broker last said, and what to do when it changes. No clock, no I/O; every call takes now_ms.
notes
The AgentMux system notes agents get about cloud delivery, and the per-agent bookkeeping behind the resume note. Pure: times come in as unix ms, and hhmm is the one place they become wall-clock text.

Structs§

Runtime 🔒
Sinks 🔒

Constants§

EVENT_MUXBUS_STATUS
The WebSocket event carrying a changed MuxBusDeliveryStatus.
TICK 🔒
How often the state is re-derived (the broker can move on its own) and the time-based notes are checked.

Statics§

RUNTIME 🔒
SIGN_IN_NOTICE_OWED 🔒
The episode’s notification is owed but had no router to go to (no window had connected yet); run_tick sends it once one exists.

Functions§

apply 🔒
broker_state 🔒
deliver 🔒
deliver_one 🔒
Deliver note (its attempt-th try); a failure is retried on later ticks.
fetched
One agent’s pull answered: delivered messages reached it and the relay reported expired. Sends its resume or expiry note, if it has one; call after the pull’s own messages are delivered, so the note comes last.
fresh_sign_in
The user just signed in (muxbus.login).
install
Where status changes and the notification go. Call once at startup; starts the tick. Before this, state is still tracked but nothing is sent.
pull_failed
agent’s pull (fetch or claim) got no usable answer from the relay, though the WebSocket may be open: its messages aren’t arriving.
router 🔒
rt 🔒
run_tick 🔒
saw_session
The subscriber found a stored sign-in, or a sign-in just succeeded.
send_owed_sign_in_notice 🔒
set_link
What the subscriber’s loop is doing now.
signed_out
The user signed out (muxbus.disconnect).
status
The current state, for muxbus.status.
subscribed_agents 🔒