Expand description
The two tasks that move frames, and the dispatcher between them.
- The writer drains the outgoing channel onto the socket, one frame at a time, and ends when the channel closes.
- The reader decodes frames and hands each
NodeEventtodispatch, then closes the session when the socket ends.
dispatch is deliberately a free function over shared state rather
than a method on a task: the testing harness calls it directly to inject an
event, and the operator runtime will call it to fan one event out to
several operators. There is exactly one implementation of “what does this
event mean to a node”, and everything uses it.
§What the node never sees
Three events are handled entirely inside the session and are not delivered to the node’s stream:
| Event | Handled by |
|---|---|
Registered | The init handshake, before the pump starts |
ExtValue | Whoever called crate::Node::ext_load |
RouteUpgrade / RouteDowngrade | The RouteTable, which also sends the ack (§6.3) |
InputRouteUpgrade / InputRouteDowngrade | The InputRouteTable, which attaches or detaches the ring (§6.3) |
Everything else reaches the node, because everything else is something a node might reasonably act on.
The two route pairs are the same handshake seen from its two ends, and
neither reaches the node’s stream: a route changing plane is not an event
an application acts on, it is a change in how the events it does act on
are carried. What a node sees is crate::Payload::is_zero_copy turning
true.
Structs§
- Session
Tasks - The join handles of a running session.
Functions§
- dispatch
- Turns one
NodeEventinto whatever it means for this node. - handle_
frame - Decodes one frame and dispatches it.
- spawn
- Starts the reader and writer tasks for an established link.