Package io.deephaven.base.queue
Interface ConcurrentQueue<T>
- Type Parameters:
T
- the contained type
- All Known Subinterfaces:
ConcurrentPriorityQueue<T>
- All Known Implementing Classes:
LockFreeArrayQueue
public interface ConcurrentQueue<T>
Common interface for LockFreeArrayQueue and variants.
-
Method Summary
Modifier and TypeMethodDescriptiondequeue()
Returns null when the queue is empty This method should never block (but it may spin for a finite amount of time)boolean
Returns false when the queue is full This method should never block (but it may spin for a finite amount of time)boolean
Spins forever until the item can be enqueued.peek()
Return the current next value, or null if the queue is empty.void
Only return when enqueued.take()
Only return w/ a dequeued value.
-
Method Details
-
enqueue
Returns false when the queue is full This method should never block (but it may spin for a finite amount of time) -
enqueue
Spins forever until the item can be enqueued. Calls yield() after the number of specified spins. -
dequeue
T dequeue()Returns null when the queue is empty This method should never block (but it may spin for a finite amount of time) -
put
Only return when enqueued. (Might spin continuously) -
take
T take()Only return w/ a dequeued value. (Might spin continuously) -
peek
T peek()Return the current next value, or null if the queue is empty.
-