Interface IQueue<E>

Concurrent, distributed, observable queue.

Methods that require serialization/deserialization may throw RangeError, e.g when there is no suitable serializer for a certain type.

Type Parameters

  • E

Hierarchy

Methods

  • Adds given item to the end of the queue. Operation is successful only if queue has required capacity.

    Throws

    IllegalStateError if queue is full.

    Returns

    true.

    Parameters

    • item: E

      element to add.

    Returns Promise<boolean>

  • Adds all items in the specified item array to this queue. If items array changes during this operation, behaviour is unspecified.

    Returns

    true if this queue changed, false otherwise.

    Parameters

    • items: E[]

      items to be added.

    Returns Promise<boolean>

  • Adds an item listener for this queue. Listener will be invoked for any add/remove item events.

    Returns

    Registration id of the listener.

    Parameters

    • listener: ItemListener<E>
    • includeValue: boolean

      true if updated item should be included in the event.

    Returns Promise<string>

  • Removes all of the elements in this queue.

    Returns Promise<void>

  • Returns true if this queue contains the given item.

    Returns

    true if this queue contains the item, false otherwise.

    Parameters

    • item: E

    Returns Promise<boolean>

  • Checks if this queue contains all of the items in given array.

    Returns

    true if thi queue contains all items, false otherwise.

    Parameters

    • items: E[]

    Returns Promise<boolean>

  • Removes all items in this queue and add them to the end of given arr.

    Returns

    number of items moved from this queue to the array.

    Parameters

    • arr: E[]
    • Optional maxElements: number

      maximum number of elements that would be moved.

    Returns Promise<number>

  • Checks if this queue contains any element.

    Returns

    true if number of elements in this queue is 0.

    Returns Promise<boolean>

  • Inserts given item at the end of the queue if there is room. If queue capacity is full, offer operation fails.

    Returns

    true if the item is successfully added, false otherwise.

    Parameters

    • item: E
    • Optional time: number

      if specified, operation waits for time milliseconds for space to become available before returning false.

    Returns Promise<boolean>

  • Retrieves, but does not remove the head of this queue.

    Returns

    the head of this queue or null if the queue is empty.

    Returns Promise<E>

  • Retrieves and removes the top of this queue.

    Returns

    the head of this queue or null if no element is available.

    Parameters

    • Optional time: number

      operation waits upto time milliseconds if this queue is empty. The default value of this parameter is 0, which means no waiting.

    Returns Promise<E>

  • Inserts the item at the end of this queue. It waits to return until space becomes available if necessary.

    Parameters

    • item: E

    Returns Promise<void>

  • Returns the number of additional items, this queue can contain.

    Returns

    remaining capacity or Integer.MAX_VALUE at server side.

    Returns Promise<number>

  • Removes an instance of given item from this queue.

    Returns

    true if this queue changed, false otherwise.

    Parameters

    • item: E

    Returns Promise<boolean>

  • Removes all items in given items from this queue.

    Returns

    true if this queue changed, false otherwise.

    Parameters

    • items: E[]

    Returns Promise<boolean>

  • Removes an item listener for this queue.

    Returns

    true if the item listener is removed, false otherwise.

    Parameters

    • registrationId: string

      Registration id of the listener to be removed.

    Returns Promise<boolean>

  • Retains only the items that are present it given items.

    Returns

    true if this queue changed, false otherwise.

    Parameters

    • items: E[]

    Returns Promise<boolean>

  • Returns the number of items in this queue.

    Returns

    number of items or Integer.MAX_VALUE if number of elements is more than Integer.MAX_VALUE on server side.

    Returns Promise<number>

  • Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.

    Returns

    head of the queue.

    Returns Promise<E>

  • Returns an array that contains all items of this queue in proper sequence.

    Returns Promise<E[]>

Generated using TypeDoc