Skip to main content

await_current

Function await_current 

Source
async fn await_current(
    state: &TransportState,
    slot: &SessionSlot,
    current: &impl Fn(&Arc<Held>) -> bool,
    within: Duration,
) -> Option<Arc<Held>>
Expand description

Wait, up to within, for slot’s held copy to satisfy current, and answer it when it does.

The notice is enabled before the first look, so a copy that moves between the look and the wait is still seen on this pass rather than costing the caller its whole budget. None when no current copy arrives, which the caller answers as a seat with no conversation.