Package akka.dispatch
Class AbstractBoundedNodeQueue<T>
- java.lang.Object
 - 
- akka.dispatch.AbstractBoundedNodeQueue<T>
 
 
- 
- Direct Known Subclasses:
 BoundedNodeMessageQueue
public abstract class AbstractBoundedNodeQueue<T> extends java.lang.ObjectLock-free bounded non-blocking multiple-producer single-consumer queue based on the works of: Andriy Plokhotnuyk (https://github.com/plokhotnyuk) - https://github.com/plokhotnyuk/actors/blob/2e65abb7ce4cbfcb1b29c98ee99303d6ced6b01f/src/test/scala/akka/dispatch/Mailboxes.scala (Apache V2: https://github.com/plokhotnyuk/actors/blob/master/LICENSE) Dmitriy Vyukov's non-intrusive MPSC queue: - https://www.1024cores.net/home/lock-free-algorithms/queues/non-intrusive-mpsc-node-based-queue (Simplified BSD) 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractBoundedNodeQueue.Node<T> 
- 
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractBoundedNodeQueue(int capacity) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(T value)booleanaddNode(AbstractBoundedNodeQueue.Node<T> n)intcapacity()booleanisEmpty()Tpeek()protected AbstractBoundedNodeQueue.Node<T>peekNode()Tpoll()Removes the first element of this queue if anyAbstractBoundedNodeQueue.Node<T>pollNode()Removes the first element of this queue if anyintsize()Returns an approximation of the queue's "current" size 
 - 
 
- 
- 
Method Detail
- 
peekNode
protected final AbstractBoundedNodeQueue.Node<T> peekNode()
 
- 
peek
public final T peek()
- Returns:
 - the first value of this queue, null if empty
 
 
- 
capacity
public final int capacity()
- Returns:
 - the maximum capacity of this queue
 
 
- 
add
public final boolean add(T value)
 
- 
addNode
public final boolean addNode(AbstractBoundedNodeQueue.Node<T> n)
 
- 
isEmpty
public final boolean isEmpty()
 
- 
size
public final int size()
Returns an approximation of the queue's "current" size 
- 
poll
public final T poll()
Removes the first element of this queue if any- Returns:
 - the value of the first element of the queue, null if empty
 
 
- 
pollNode
public final AbstractBoundedNodeQueue.Node<T> pollNode()
Removes the first element of this queue if any- Returns:
 - the `Node` of the first element of the queue, null if empty
 
 
 - 
 
 -