public interface Source
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
dequeue()
Dequeues the next element, or
null if there is
nothing left on the queue or in case of a timeout while
attempting to obtain the mutex. |
java.lang.Object[] |
dequeue(int num)
Dequeues at most
num available elements. |
java.lang.Object[] |
dequeueAll()
Dequeues all available elements.
|
void |
setTimeout(long millis)
Sets the timeout on a blocking Source.
|
int |
size()
Returns the number of elements waiting in this Source.
|
void setTimeout(long millis)
1 will force all dequeue operations to
block for up to that number of milliseconds waiting for new
elements. Values below 1 will turn off blocking for
Source. This is intentional because a Source should never block
indefinitely.millis - Number of milliseconds to blockjava.lang.Object dequeue()
null if there is
nothing left on the queue or in case of a timeout while
attempting to obtain the mutex.java.lang.Object[] dequeueAll()
java.lang.Object[] dequeue(int num)
num available elements. Returns a
zero-sized array in case of a timeout while attempting to obtain
the mutex or if there is nothing left on the Source.num - The maximum number of elements to dequeuenum elements from the Sourceint size()