Function bicoro::dispatch

source ·
pub fn dispatch<'a, IA, IB, IAB, OA, OB, A, B>(
    first: Coroutine<'a, IA, OA, A>,
    second: Coroutine<'a, IB, OB, B>
) -> Coroutine<'a, Select<IA, IB, IAB>, UnicastSelect<OA, OB>, DispatchResult<'a, IA, IB, OA, OB, A, B>>where
    IAB: Into<IA> + Into<IB> + Clone,
    OA: Send,
    OB: Send,
    A: Send,
    B: Send,
Expand description

Run two co-routines, sharing inputs depending on selector.

This can be thought of as running them almost in parralel. Selector will route the input as needed to coroutines a and b Values that can be sent to both, if the selector selects both and the both value is cloneable and convertable