Class IterableQueue<Element>

Exposes an AsyncIterable interface for the BlockingQueue.

Type Parameters

  • Element

Hierarchy

Implements

  • AsyncIterable<Element>

Constructors

Accessors

Methods

Constructors

Accessors

  • get length(): number
  • Returns number

Methods

  • Returns AsyncIterator<Element, any, undefined>

  • Gets an element when one is ready, waits if none are ready.

    Returns Promise<undefined | Element>

    Element or undefined if queue is empty and done has been called

  • Add an item to the queue, wait if the queue is full.

    Parameters

    • item: Element

      Element to add

    Returns Promise<void>

  • Used by the iterator returned from [Symbol.asyncIterator] Called every time an item is needed

    Returns Promise<IteratorResult<Element, any>>

    Iterator result

Generated using TypeDoc