Expand description
borg mesh serve: one node, running until it is told to stop.
- Accepts members dialling in, each session in its own task (sync.rs gates every one).
- Dials every member listed in peers.json: every
interval, and at once when the store changed locally (a hook wrote a lesson or an excerpt, a session brought new lines,revokere-signed the membership), checked everypoll. Each peer is dialled on its own, side by side: one that does not answer holds up no other for itstimeout. A change made while a peer’s dial runs, or that a failed dial did not carry, is owed to it and dialled once that dial ends or its backoff is over. A changed membership is applied to the logs (quarantine) at once, before the round. New lines therefore travel on: what B learns from A reaches C in B’s next round, at the nextpollonce the session ends. - Backs off per peer on failure:
pollafter the first, theninterval · 2^(failures - 1), at mostbackoff_max; a success resets it. A failed dial also drops the peer frommesh/synced.json(borg presence.rs). - Re-checks the gate every round on the config as it is then: once the collective turns local or off (or the repo moves to another store) no round dials anyone, and incoming sessions are refused by sync.rs. Turning it back on resumes without a restart.
- Stops cleanly when
shutdownresolves: no new sessions, running ones getgrace, then the endpoint closes (peers see a closed connection, not a timeout).
Not a coordinator: every node runs the same loop, and the hooks never depend on it.
Structs§
- Options
- The loop’s timing.
Defaultis the one place its values are written:borg mesh serve’s--intervaldefault and the bounds of the one-shot commands (main.rs) read them from it.
Enums§
- Event
- What the loop tells its caller (the CLI prints it, tests count it).