InputType - input dataOutputResultType - output resultOutputErrorType - errorpublic class LimitAsyncOperations<InputType,OutputResultType,OutputErrorType extends Exception> extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
LimitAsyncOperations.Executor<InputType,OutputResultType,OutputErrorType extends Exception>
Executor of write operation.
|
| Constructor and Description |
|---|
LimitAsyncOperations(int maxOperations,
LimitAsyncOperations.Executor<InputType,OutputResultType,OutputErrorType> executor)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
IAsync<OutputErrorType> |
flush()
Same as getLastPendingOperation but never return null (return an unblocked synchronization point instead).
|
AsyncSupplier<OutputResultType,OutputErrorType> |
getLastPendingOperation()
Return the last pending operation, or null.
|
AsyncSupplier<OutputResultType,OutputErrorType> |
write(InputType data)
Queue the data to write.
|
protected void |
writeDone(InputType data,
AsyncSupplier<OutputResultType,OutputErrorType> result) |
public LimitAsyncOperations(int maxOperations,
LimitAsyncOperations.Executor<InputType,OutputResultType,OutputErrorType> executor)
public AsyncSupplier<OutputResultType,OutputErrorType> write(InputType data) throws IOException
data - the data to write.IOExceptionprotected void writeDone(InputType data, AsyncSupplier<OutputResultType,OutputErrorType> result)
public AsyncSupplier<OutputResultType,OutputErrorType> getLastPendingOperation()
public IAsync<OutputErrorType> flush()
Copyright © 2019. All rights reserved.