Skip to main content

Module manager

Module manager 

Source
Expand description

The sans-io UdpManager: admission, flow table, LB request, timers.

UdpManager owns the flow table (HashMap<FlowKey, FlowId> over a slab::Slab<UdpFlow>), admission (“allocate nothing for unknown / over-cap / invalid datagrams”), the flow-table cap and shedding, pluggable flow-key extraction (FlowKeyExtractor), the LB-selection request for new flows (it emits Output::SelectBackend; the shell does the actual LB), and the timer scheduling: a single armed manager-wide deadline plus per-flow generation tokens so a stale expiry can never close a refreshed flow.

Pure: every entry point that depends on time takes now: Instant; the hash seed is injected at construction. The shell drives the manager with ManagerInput and drains Output via [poll_output].

Structs§

SourceTupleExtractor
The in-scope flow-key extractor: keys on the real client source address, honouring the cluster’s affinity_with_port knob (4-tuple vs 2-tuple).
UdpManager
The pure UDP flow manager. Generic over the flow-key extractor so the seam stays type-checked; the shell instantiates it with SourceTupleExtractor.

Traits§

FlowKeyExtractor
Extracts a FlowKey from an admitted client datagram. The default SourceTupleExtractor keys on the real client source address (2-tuple source-IP or 4-tuple source-IP+port per cluster config). The trait is the only seam for alternative keying (e.g. a QUIC-CID extractor, a non-goal); the 4-tuple impl is the only one in scope.