property ChannelOptions.onDiscard

Called with each element the buffer actually lost, and the depth after the loss. The only place overflow is observable — make it fatal from here by calling fail or abort.

Type

(
dropped: T | E,
buffered: number
) => void

Usage

import { type ChannelOptions } from "lib/stream/stream.ts";