Skip to main content

Module bus

Module bus 

Source
Expand description

The broker: a durable, keep-until-acked FIFO per recipient over HTTP.

The bus is deliberately dumb — it routes an opaque JSON payload to a recipient id, never inspects it, never verifies a signature, holds no keys. Messages persist in a Store until the recipient acks them, so a bus restart doesn’t lose anything queued for an offline agent. Delivery is at-least-once; the recipient dedupes by msg_id, so a redelivered message is harmless.

Recipients are Ed25519 public keys (base64). The bus treats them as strings.

Structs§

Broker
Envelope
A payload addressed to a recipient, stamped on arrival.

Constants§

AWAY_RETAIN_MS
How long a presence announcement is retained without a refresh. Generous — covering a multi-day laptop sleep — because a silent session may just be asleep, not gone (a graceful close removes it immediately via /unregister). Clients classify each entry live-vs-away from the age_ms the roster reports; this bound only decides when a long-silent entry is finally dropped. See docs/PRESENCE.md.
DEFAULT_RECV_TIMEOUT_MS