Control backpressure for listening streams. This interface is the API internal to the implementation of backpressure(). Unless you're implementing a backpressurable stream yourself, see the Throttle interface instead.

interface Inlet {
    isOpen(): boolean;
    isReady(): boolean;
    onReady(cb: (() => any), job: Job<any>): this;
}

Hierarchy (view full)

Methods

  • Is the main connection open? (i.e. is the creating job not closed yet?)

    Returns boolean

  • Is the connection ready to receive data?

    Returns boolean

  • Register a callback to produce more data when the inlet is resumed (The callback is unregistered if the supplied job ends.)

    Parameters

    • cb: (() => any)
        • (): any
        • Returns any

    • job: Job<any>

    Returns this