Class default<T>

A queue that batches and delays items to limit concurrent processing and reduce external API load.

Typeparam

T Type of items in the queue.

Type Parameters

  • T = any

Hierarchy

  • EventEmitter
    • default

Implements

Constructors

  • Constructs a new BucketQueue object.

    Throws

    If the provided options do not meet the requirements.

    Type Parameters

    • T = any

    Parameters

    Returns default<T>

Accessors

  • get constructionEvents(): ConstructionEventsObject
  • Returns a frozen object containing all stored construction events. The object keys represent the event types and the values are arrays of event arguments. Note that this method only returns stored construction events that have not been emitted yet. Once an event is emitted, it will be removed from the stored events map.

    Returns ConstructionEventsObject

  • get options(): {
        interval: number;
        maxBatch: number;
        minBatch: number;
    }
  • Returns the current options object used by the BucketQueue. The returned object is frozen and cannot be modified.

    Returns

    An object containing the current options of the BucketQueue.

    Returns {
        interval: number;
        maxBatch: number;
        minBatch: number;
    }

    • interval: number
    • maxBatch: number
    • minBatch: number
  • get pressure(): number
  • Returns the current length of the bucket, representing the number of items waiting to be processed.

    Returns

    The current length of the bucket.

    Returns number

Methods

  • Pause the BucketQueue by corking it, preventing any more events from processing.

    Returns

    void

    Returns void

  • Alias for the remove method.

    Parameters

    • item: T

      The item to remove.

    Returns void

  • Remove an item from the queue if it exists.

    Parameters

    • item: T

      The item to remove.

    Returns void

  • Resume the BucketQueue by uncorking it, allowing events to continue processing.

    Returns

    void

    Returns void

Generated using TypeDoc