public class FutureAlgoResponse extends java.lang.Object implements java.util.concurrent.Future<AlgoResponse>
Future<AlgoResponse>
will allow other async scenarios
(e.g. where the internal implementation is based on polling instead of long-lived connections)
without changing the exposed interfaceModifier and Type | Field and Description |
---|---|
protected java.util.concurrent.Future<AlgoResponse> |
promise |
Modifier | Constructor and Description |
---|---|
protected |
FutureAlgoResponse() |
|
FutureAlgoResponse(java.util.concurrent.Future<AlgoResponse> promise) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInerruptIfRunning) |
AlgoResponse |
get() |
AlgoResponse |
get(long timeout,
java.util.concurrent.TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
protected java.util.concurrent.Future<AlgoResponse> promise
protected FutureAlgoResponse()
public FutureAlgoResponse(java.util.concurrent.Future<AlgoResponse> promise)
public boolean cancel(boolean mayInerruptIfRunning)
cancel
in interface java.util.concurrent.Future<AlgoResponse>
public boolean isCancelled()
isCancelled
in interface java.util.concurrent.Future<AlgoResponse>
public boolean isDone()
isDone
in interface java.util.concurrent.Future<AlgoResponse>
public AlgoResponse get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get
in interface java.util.concurrent.Future<AlgoResponse>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public AlgoResponse get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
get
in interface java.util.concurrent.Future<AlgoResponse>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException