|
Fray Engine
|
Classes | |
| class | NeighborMonitor |
| Tracks neighbor liveness and health from what the router hears, and reports state transitions. Not thread safe: all calls and callbacks run on the router (engine message) thread. Never blocks or waits on a neighbor; the clock is injected so time-based rules (3s suspect/degraded, 10s down/unreachable) can be tested. It holds no readiness table itself; the owning router is the source of truth, read through the State callback. More... | |
| class | OutgoingRouter |
| The router thread's single source of truth about which neighbors are ready, plus the messages waiting for them. Nothing here is thread safe: only the router thread may touch it. Nothing waits on a neighbor either. A message for a neighbor that is not ready stays in its queue until the neighbor says it is ready, its time to live runs out, or the neighbor is declared down and its queue is discarded. More... | |
Enumerations | |
| enum class | Destination { engine , relay , unsupported } |
| Where an incoming message should be handled. More... | |
| enum class | MonitorCommand { probe , ping } |
| What the monitor asks its Send callback to transmit: probe = ask for readiness, ping = request a health report. More... | |
| enum class | NeighborState { unknown , probing , ready , suspect , degraded , down , unreachable } |
| Readiness of a neighbor process as seen by the router. unknown: nothing known yet; probing: readiness requested, no answer yet; ready: messages are delivered at once; suspect: quiet for a while; degraded: heard from but its health looks bad (stalled heartbeat, stuck queue or no report); down: silent too long, its queue is discarded; unreachable: never answered the initial probe. Only ready delivers immediately; every other state queues messages. More... | |
Functions | |
| Destination | routeMessage (const message::Prefix &prefix) |
| Decides where an incoming message goes from its prefix destination. Pure apart from logging; may run on any thread. | |
|
strong |
Where an incoming message should be handled.
Definition at line 18 of file message_router.hpp.
|
strong |
What the monitor asks its Send callback to transmit: probe = ask for readiness, ping = request a health report.
| Enumerator | |
|---|---|
| probe | |
| ping | |
Definition at line 16 of file neighbor_monitor.hpp.
|
strong |
Readiness of a neighbor process as seen by the router. unknown: nothing known yet; probing: readiness requested, no answer yet; ready: messages are delivered at once; suspect: quiet for a while; degraded: heard from but its health looks bad (stalled heartbeat, stuck queue or no report); down: silent too long, its queue is discarded; unreachable: never answered the initial probe. Only ready delivers immediately; every other state queues messages.
| Enumerator | |
|---|---|
| unknown | |
| probing | |
| ready | |
| suspect | |
| degraded | |
| down | |
| unreachable | |
Definition at line 27 of file outgoing_router.hpp.
|
inline |
Decides where an incoming message goes from its prefix destination. Pure apart from logging; may run on any thread.
| prefix | Parsed message prefix whose destinationKind (and destinationId, for the log) is inspected. |
Definition at line 35 of file message_router.hpp.