mot

queue

package queue

Visibility
  1. Public
  2. All

Type Members

  1. class LinkedBlockingMultiQueue[A, E >: Null] extends Pollable[E]

    An optionally-bounded blocking "multi-queue" based on linked nodes.

    An optionally-bounded blocking "multi-queue" based on linked nodes. A multi-queue is actually a set of queues that are connected at the heads and have independent tails (the head of the queue is that element that has been on the queue the longest time. The tail of the queue is that element that has been on the queue the shortest time). New elements are added at the tail of one of the queues, and the queue retrieval operations obtain elements from the head of some of the queues, according to a policy that is described below.

    This class essentially allows a consumer to efficiently block a single thread on a set of queues, until one becomes available. The special feature is that individual queues can be enabled or disabled. A disabled queue is not considered for polling (in the event that all the queue are disabled, any blocking operation would do so trying to read, as if all the queues were empty). Elements are taken from the set of enabled queues, obeying the established priority (queues with the same priority are served round robin).

    A disabled queue accepts new elements normally until it reaches the maximum capacity (if any).

    Individual queues can be address, removed, enabled or disabled at any time, without any concurrency restrictions.

    The optional capacity bound constructor argument serves as a way to prevent excessive queue expansion. The capacity, if unspecified, is equal to Int.MaxVaue. Linked nodes are dynamically created upon each insertion unless this would bring the queue above capacity.

    Not being actually a linear queue, this class does not implement the Collection or Queue interfaces. The traditional queue interface is split in the traits: Offerable and Pollable.

  2. trait Offerable[-T] extends AnyRef

    This trait captures the "tail side" of the BlockingQueue interface

    This trait captures the "tail side" of the BlockingQueue interface

  3. trait Pollable[+T] extends AnyRef

    This trait captures the "head side" of the BlockingQueue interface

    This trait captures the "head side" of the BlockingQueue interface

Value Members

  1. object LinkedBlockingMultiQueue

Ungrouped