public final class CompletedFuture<V> extends Object implements InternalCompletableFuture<V>
| Constructor and Description |
|---|
CompletedFuture(SerializationService serializationService,
Object value,
Executor userExecutor) |
| Modifier and Type | Method and Description |
|---|---|
void |
andThen(ExecutionCallback<V> callback)
Registers a callback that will run after this future is completed.
|
void |
andThen(ExecutionCallback<V> callback,
Executor executor)
Registers a callback that will run with the provided executor after this
future is completed.
|
boolean |
cancel(boolean mayInterruptIfRunning) |
boolean |
complete(Object value)
Completes this future.
|
V |
get() |
V |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
V |
join()
Waits for this future to complete.
|
public CompletedFuture(SerializationService serializationService, Object value, Executor userExecutor)
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 V join()
InternalCompletableFuturejoin in interface InternalCompletableFuture<V>public boolean complete(Object value)
InternalCompletableFuturecomplete in interface InternalCompletableFuture<V>value - the value to complete this future with.true if this invocation caused this InternalCompletableFuture to complete, else falsepublic boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled in interface Future<V>public void andThen(ExecutionCallback<V> callback)
ICompletableFuturePlease note that there is no ordering guarantee for running multiple callbacks. It is also not guaranteed that the callback will run within the same thread that completes the future.
andThen in interface ICompletableFuture<V>callback - the callback to executepublic void andThen(ExecutionCallback<V> callback, Executor executor)
ICompletableFutureexecutor.
Please note that there is no ordering guarantee for executing multiple
callbacks.andThen in interface ICompletableFuture<V>callback - the callback to executeexecutor - the executor in which the callback will be runCopyright © 2020 Hazelcast, Inc.. All Rights Reserved.