pub fn scope_close(
component: &Arc<RwLock<Component>>,
cadence_reporter: &CadenceReporter,
interval: Duration,
)Expand description
SRD-40b §11 / SRD-42 §“Component lifecycle: scope_close flush” —
fused teardown helper. Captures a final delta from this component’s
instruments, fires the cadence reporter’s scope_close (which
marks the partial, ingests, and closes the path), and transitions
the component to ComponentState::Stopped.
Only acts on Running components. Components that are
Starting, Stopping, or already Stopped return without
touching the reporter — calling scope_close twice on the same
component is a no-op on the second call, matching SRD-40 §
component lifecycle.
Components with no registered instruments still close the path so any in-flight prebuffer at that label set (e.g. ingests routed via a sibling layer) flushes through the cascade.