Skip to main content

Module pump

Module pump 

Source
Expand description

WS event pumps: parse in the receiver task, never block on a slow consumer.

The frames of the WebSocket session come in through a channel. The pump gives each one to its core and hands the events to the [Emitter]: per-subscription buffers in front of the bot’s channel. A bot that reads slowly fills the buffer of a subscription, and the policy of that subscription applies: Conflate keeps the latest, DropNewest counts drops, Lossless overflows (Event::Overflow, connector Degraded).

Functions§

drain_backlog
Gives the bot’s channel time to take what the buffers still hold (shutdown).
run_pump
Runs an event pump until cancel fires or the frame channel closes.