collect-your-stuff
    Preparing search index...

    Interface IsQueue<T>

    Define a first-in-first-out queue: items are added to the back (enqueue) and taken from the front (dequeue). This is the shape which si-funciona's queueManager / queueTimeout expect of a queue.

    interface IsQueue<T = any> {
        dequeue: () => T;
        empty: () => boolean;
        enqueue: (data: T) => void;
        peek: () => T;
        size: () => number;
    }

    Type Parameters

    • T = any

    Implemented by

    Index
    dequeue: () => T

    Take the item from the front of the queue.

    Type Declaration

      • (): T
      • Returns T

        The item, or null when the queue is empty

    empty: () => boolean

    Check whether the queue has no items.

    enqueue: (data: T) => void

    Add an item to the back of the queue.

    Type Declaration

      • (data: T): void
      • Parameters

        • data: T

          The item to add

        Returns void

    peek: () => T

    Look at the item at the front of the queue, without removing it.

    Type Declaration

      • (): T
      • Returns T

        The item, or null when the queue is empty

    size: () => number

    Count the items in the queue.