An util for buffering arbitrary items until a size condition is fulfilled in which case an asynchronous drain method will be invoked

Type Parameters

  • T

Hierarchy

  • BufferExec

Constructors

Properties

Methods

Constructors

  • Type Parameters

    • T

    Parameters

    • exec: ((items: T[]) => Promise<void>)
        • (items: T[]): Promise<void>
        • Parameters

          • items: T[]

          Returns Promise<void>

    • size: number = 1000
    • time: number = 0

    Returns BufferExec<T>

Properties

buffer: T[] = []
exec: ((items: T[]) => Promise<void>)

Type declaration

    • (items: T[]): Promise<void>
    • Parameters

      • items: T[]

      Returns Promise<void>

lastDrain: Promise<void> = ...
size: number = 1000
time: number = 0
timeout: undefined | Timeout

Methods

Generated using TypeDoc