Skip to main content

record_until_stopped

Function record_until_stopped 

Source
async fn record_until_stopped(
    key: &SessionSlot,
    capture: &CaptureMeter,
    stop: &mut Receiver<bool>,
    updates: &UpdateFanout,
    cap: Duration,
    generation: u64,
    initiator: Option<u64>,
) -> bool
Expand description

Stream level events until a stop decision or the capture cap stops itself. Returns whether the take should be submitted.

cap is enforced HERE as well as in the capture, by wall clock: the sample cap fires only while audio arrives, so a take whose stream stops mid-take has nothing to notice it and would hold the seat until teardown.

The select is biased to the stop arm: a stop queued when a meter tick is ready in the same poll cancels the take, so the cap cannot submit one the user already cancelled.