Skip to content

FrameHold

Defined in: frame-hold.ts:20

Keeps frames in order until release, then passes them, and every later one, straight on.

Type Parameter
Frame
readonly isReleased: boolean;

Defined in: frame-hold.ts:34

Whether release was called.


readonly stats: Readonly<FrameHoldStats>;

Defined in: frame-hold.ts:36

Counters.

clear(): void;

Defined in: frame-hold.ts:32

Drop every kept frame; later frames are kept again until release. Does nothing once released.

void


push(frame): void;

Defined in: frame-hold.ts:22

Keep a frame, or pass it on once released. A frame reader’s onFrame can be this method.

Parameter Type
frame Frame

void


release(consumer): void;

Defined in: frame-hold.ts:30

Pass every kept frame to consumer, oldest first, then every later frame as it comes. Once only. A frame pushed from inside consumer while the kept ones are passed on waits its turn behind them. A kept frame the consumer throws on does not stop the rest: each is passed on, and the first error is thrown after the last (as a frame reader’s onFrame failing for one frame does not lose the next). After release, push throws what the consumer throws.

Parameter Type
consumer (frame) => void

void