Result - the type of the result for this futureV - the type of the value for this futurepublic interface PrecipiceFuture<Result extends Failable,V> extends java.util.concurrent.Future<V>, ResultView<Result,V>
| Modifier and Type | Method and Description |
|---|---|
void |
await()
Block until the completion of the future.
|
void |
await(long duration,
java.util.concurrent.TimeUnit unit)
Block until the completion of the future or until the time duration is exceeded.
|
void |
onError(PrecipiceFunction<Result,java.lang.Throwable> fn)
Attaches a callback to be executed if the future is not completed successfully.
|
void |
onSuccess(PrecipiceFunction<Result,V> fn)
Attaches a callback to be executed if the future is completed successfully.
|
getError, getResult, getValuevoid onSuccess(PrecipiceFunction<Result,V> fn)
fn - function to be executedvoid onError(PrecipiceFunction<Result,java.lang.Throwable> fn)
fn - function to be executedvoid await()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionvoid await(long duration,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
duration - the maximum duration to waitunit - the unit of the duration argumentjava.lang.InterruptedExceptionCopyright © 2014 Tim Brooks. All Rights Reserved.