Skip to main content

run_pump

Function run_pump 

Source
pub async fn run_pump<C, F, Fut>(
    core: Arc<Mutex<C>>,
    emitter: Arc<Emitter>,
    rx: AsyncReceiver<WsIncoming>,
    cancel: CancellationToken,
    after: F,
)
where C: BrokerCore<Frame = WsIncoming>, F: Fn() -> Fut, Fut: Future<Output = ()>,
Expand description

Reads frames from rx until cancel, runs them through core, and gives the events to emitter. after runs after every frame with the core locked out, so a connector can act on what the core noted (a book to ask for again).