BurstQueue

s2a.leucine.actors.BurstQueue
class BurstQueue[M] extends ShareQueue[M]

Mutable class for managing the message queue . We want this to be fast, and we know we always empty all at once, after which it may grow again. Therefore we might as well use a list. Growing is fast, and whatever other structure we use, there will at least be once an O(n) operation involved. In case there are not a lot of messages List wins from the other collections because of the low overhead setup.

Attributes

Graph
Supertypes
class ShareQueue[M]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def dequeue(tail: List[M]): List[M]

Get all the messages in posted order, clear queue. Since the list must be reversed this is not fast O(n). If there is already a tail, elements of the queue are prepended.

Get all the messages in posted order, clear queue. Since the list must be reversed this is not fast O(n). If there is already a tail, elements of the queue are prepended.

Attributes

Inherited methods

def clear(): Unit

Remove all messages from the queue(s), always fast: O(1)

Remove all messages from the queue(s), always fast: O(1)

Attributes

Inherited from:
ShareQueue
def enqueue(message: M): Unit

Put an element on the queue. Always fast O(1).

Put an element on the queue. Always fast O(1).

Attributes

Inherited from:
ShareQueue
def isEmpty: Boolean

See if the queue is empty, always fast: O(1)

See if the queue is empty, always fast: O(1)

Attributes

Inherited from:
ShareQueue
def max: Int

The maximum number of messages that were held in the queue at once

The maximum number of messages that were held in the queue at once

Attributes

Inherited from:
ShareQueue
def reset(): Unit

Clear the statistics on this queue. The queue itself remains as is.

Clear the statistics on this queue. The queue itself remains as is.

Attributes

Inherited from:
ShareQueue
def size: Int

The size of this queue, always fast: O(1)

The size of this queue, always fast: O(1)

Attributes

Inherited from:
ShareQueue
def sum: Int

The total number of messages that were processed by the queue

The total number of messages that were processed by the queue

Attributes

Inherited from:
ShareQueue