Package com.db4o.foundation
Interface PausableBlockingQueue4<T>
-
- All Superinterfaces:
BlockingQueue4<T>
,Queue4<T>
- All Known Subinterfaces:
TimeoutBlockingQueue4<T>
- All Known Implementing Classes:
PausableBlockingQueue
,TimeoutBlockingQueue
public interface PausableBlockingQueue4<T> extends BlockingQueue4<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isPaused()
boolean
pause()
Pauses the queue, making calls toQueue4.next()
block untilresume()
is called.boolean
resume()
Resumes the queue, releasing blocked calls toQueue4.next()
that can reach a next queue item..T
tryNext()
Returns the next element in queue if there is one available, returns null otherwise.-
Methods inherited from interface com.db4o.foundation.BlockingQueue4
drainTo, next, stop
-
-
-
-
Method Detail
-
pause
boolean pause()
Pauses the queue, making calls to
Queue4.next()
block untilresume()
is called.- Returns:
- whether or not this call changed the state of the queue.
-
resume
boolean resume()
Resumes the queue, releasing blocked calls to
Queue4.next()
that can reach a next queue item..- Returns:
- whether or not this call changed the state of the queue.
-
isPaused
boolean isPaused()
-
tryNext
T tryNext()
Returns the next element in queue if there is one available, returns null otherwise.
This method will not never block, regardless of the queue being paused or no elements are available.
- Returns:
- next element, if available and queue not paused.
-
-