Interface Completion<T>
- All Known Subinterfaces:
Async, TestCompletion
public interface Completion<T>
A completion object that emits completion notifications either succeeded or failed.
- Author:
- Julien Viet
-
Method Summary
Modifier and TypeMethodDescriptionvoidawait()Cause the current thread to wait until this completion completes.voidawait(long timeoutMillis) Cause the current thread to wait until this completion completes with a configurable timeout.voidCause the current thread to wait until this completion completes and succeeds.voidawaitSuccess(long timeoutMillis) Cause the current thread to wait until this completion completes and succeeds with a configurable timeout.voidhandler(Handler<AsyncResult<T>> completionHandler) Completion handler to receive a completion signal when this completions completes.booleanbooleanisFailed()booleanvoidCompletes the future upon completion, otherwise fails it.
-
Method Details
-
resolve
-
isCompleted
boolean isCompleted()- Returns:
- true if this completion is completed
-
isSucceeded
boolean isSucceeded()- Returns:
- true if this completion is completed and succeeded
-
isFailed
boolean isFailed()- Returns:
- true if the this completion is completed and failed
-
handler
Completion handler to receive a completion signal when this completions completes.- Parameters:
completionHandler- the completion handler
-
await
void await()Cause the current thread to wait until this completion completes. If the current thread is interrupted, an exception will be thrown. -
await
void await(long timeoutMillis) Cause the current thread to wait until this completion completes with a configurable timeout. If completion times out or the current thread is interrupted, an exception will be thrown.- Parameters:
timeoutMillis- the timeout in milliseconds
-
awaitSuccess
void awaitSuccess()Cause the current thread to wait until this completion completes and succeeds. If the current thread is interrupted or the suite fails, an exception will be thrown. -
awaitSuccess
void awaitSuccess(long timeoutMillis) Cause the current thread to wait until this completion completes and succeeds with a configurable timeout. If completion times out or the current thread is interrupted or the suite fails, an exception will be thrown.- Parameters:
timeoutMillis- the timeout in milliseconds
-