Skip to main content

release_due_units

Function release_due_units 

Source
async fn release_due_units(
    pending: &mut PendingQueue,
    deferred: &mut DeferredEffects,
    send: &mut SendStream,
    site: Site,
    shaped: Option<&ShapedStream>,
    ctx: &ForwardCtx,
    report: &Reporter<'_>,
) -> Result<Flow, ProxyError>
Expand description

Write every unit whose release time has arrived, in order.

The body of the select! release branch, shared by the control and data pipes. Each released unit pays back exactly one ledger entry — the second half of a Delay / Hold, whose first half reported Effect::Queued when the decision was taken.

On a shaped data stream this is also where the pacer runs: every pop_next_due below is a Scheduler::acquire, so a class whose bucket is dry simply stops yielding units and the loop ends with the queue intact. Nothing about the shape of this function changes — that is the point of putting the seam in pop_next_due rather than beside it.