DataType - type of data in the queueTError - type of errorpublic class WaitingDataQueueSynchronizationPoint<DataType,TError extends Exception> extends AbstractLock<TError>
cancel, error, listeners| Constructor and Description |
|---|
WaitingDataQueueSynchronizationPoint() |
| Modifier and Type | Method and Description |
|---|---|
void |
block(long timeout)
Pause the current thread to wait for this asynchronous unit to be unblocked.
|
boolean |
blockPauseCondition()
Return true if blockPause should still block.
|
void |
endOfData()
Signal that no more data will be queued, so any waiting thread can be unblocked.
|
boolean |
isDone()
Return true if unblocked (success or cancelled).
|
void |
newDataReady(DataType data)
Queue a new data, which may unblock a thread waiting for it.
|
void |
onDone(Runnable listener)
Call listener when unblocked (whatever the result is successful, has error or is cancelled).
|
protected void |
unlock() |
DataType |
waitForData(long timeout)
To call when data is needed.
|
cancel, error, getAllListeners, getCancelEvent, getError, hasError, isCancelledclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitblockException, blockPause, blockThrow, forwardIfNotSuccessful, isSuccessful, logListenerError, onCancel, onDone, onDone, onDone, onDone, onDone, onDone, onError, onErrorOrCancel, onSuccess, thenDoOrStart, thenDoOrStart, thenDoOrStart, thenStart, thenStart, thenStart, thenStart, thenStart, thenStart, toAsyncSupplierpublic WaitingDataQueueSynchronizationPoint()
public DataType waitForData(long timeout)
public void newDataReady(DataType data)
public void endOfData()
public boolean isDone()
IAsyncpublic void block(long timeout)
IAsyncpublic boolean blockPauseCondition()
IAsyncpublic void onDone(Runnable listener)
IAsyncprotected void unlock()
unlock in class AbstractLock<TError extends Exception>Copyright © 2019. All rights reserved.