@ac-essentials/misc-util
    Preparing search index...

    Class Queue<T>

    A FIFO queue implementation.

    Type Parameters

    • T

      The type of elements in the queue.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    capacity: number = Infinity

    The maximum number of elements the collection can hold. If the collection is unbounded, this will be Infinity.

    data: LinkedList<T>

    Methods

    • Adds one or more items to the rear of the queue.

      The items are added in the order they are provided. The last item in the argument list will be the last one to be dequeued.

      Parameters

      • ...items: T[]

        The items to add to the queue.

      Returns void

      If the operation would exceed the queue's capacity.

    • Same as enqueue, but waits for capacity if the operation would exceed it.

      Parameters

      • items: Iterable<T>
      • Optionalsignal: null | AbortSignal

        Optional abort signal to cancel the operation.

      Returns Promise<void>

      IQueue.enqueue