Interface XGFViewStreamBackpressure

Optional loading gate for renderer- or application-level backpressure.

The stream controller checks this between chunk commits, pausing before it starts the next chunk and resuming only when the caller reports enough headroom. This keeps backpressure decisions outside renderer internals while preserving deterministic chunk ownership in the controller.

interface XGFViewStreamBackpressure {
    onPause?: () => void;
    onResume?: () => void;
    shouldPause: () => boolean;
    shouldResume: () => boolean;
}

Properties

onPause?: () => void

Called after backpressure pauses the controller.

onResume?: () => void

Called after backpressure resumes the controller.

shouldPause: () => boolean

Returns true when streaming should pause before committing another chunk.

shouldResume: () => boolean

Returns true when a backpressure pause may resume streaming.