V - classpublic class SignalRFuture<V> extends Object implements Future<V>
| Constructor and Description |
|---|
SignalRFuture() |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels the operation
|
boolean |
cancel(boolean mayInterruptIfRunning) |
SignalRFuture<V> |
done(Action<V> action)
Handles the completion of the Future.
|
boolean |
errorWasTriggered()
Indicates if an error was triggered
|
V |
get() |
V |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled()
Indicates if the operation is cancelled
|
boolean |
isDone() |
void |
onCancelled(Runnable onCancelled)
Handles the cancellation event
|
SignalRFuture<V> |
onError(ErrorCallback errorCallback)
Handles error during the execution of the Future.
|
void |
setResult(V result)
Sets a result to the future and finishes its execution
|
void |
triggerError(Throwable error)
Triggers an error for the Future
|
public void onCancelled(Runnable onCancelled)
onCancelled - The handlerpublic void cancel()
public void setResult(V result)
result - The future resultpublic boolean isCancelled()
isCancelled in interface Future<V>public boolean cancel(boolean mayInterruptIfRunning)
public V get() throws InterruptedException, ExecutionException
get in interface Future<V>InterruptedExceptionExecutionExceptionpublic V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get in interface Future<V>InterruptedExceptionExecutionExceptionTimeoutExceptionpublic SignalRFuture<V> done(Action<V> action)
action - The handlerpublic SignalRFuture<V> onError(ErrorCallback errorCallback)
errorCallback - The handlerpublic void triggerError(Throwable error)
error - The errorpublic boolean errorWasTriggered()
Copyright © 2019. All rights reserved.