Hazelcast C++ Client
|
A. More...
#include <IFuture.h>
Public Member Functions | |
virtual bool | cancel (bool mayInterruptIfRunning)=0 |
Attempts to cancel execution of this task. More... | |
virtual bool | isCancelled ()=0 |
Returns. More... | |
virtual bool | isDone ()=0 |
Returns. More... | |
virtual boost::shared_ptr< V > | get ()=0 |
Waits if necessary for the computation to complete, and then retrieves its result. More... | |
virtual boost::shared_ptr< V > | get (int64_t timeout, const TimeUnit &unit)=0 |
Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available. More... | |
A.
represents the result of an asynchronous computation. Methods are provided to check if the computation is complete, to wait for its completion, and to retrieve the result of the computation. The result can only be retrieved using method
when the computation has completed, blocking if necessary until it is ready. Cancellation is performed by the
method. Additional methods are provided to determine if the task completed normally or was cancelled. Once a computation has completed, the computation cannot be cancelled.
<V> | The result type returned by this Future's get |
|
pure virtual |
Attempts to cancel execution of this task.
This attempt will fail if the task has already completed, has already been cancelled, or could not be cancelled for some other reason. If successful, and this task has not started when
is called, this task should never run. If the task has already started, then the
parameter determines whether the thread executing this task should be interrupted in an attempt to stop the task.
After this method returns, subsequent calls to isDone will always return
. Subsequent calls to isCancelled will always return
if this method returned
.
mayInterruptIfRunning |
|
pure virtual |
Waits if necessary for the computation to complete, and then retrieves its result.
CancellationException | if the computation was cancelled |
ExecutionException | if the computation threw an exception |
InterruptedException | if the current thread was interrupted while waiting |
|
pure virtual |
Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
timeout | the maximum time to wait |
unit | the time unit of the timeout argument |
CancellationException | if the computation was cancelled |
ExecutionException | if the computation threw an exception |
InterruptedException | if the current thread was interrupted while waiting |
TimeoutException | if the wait timed out |
|
pure virtual |
Returns.
if this task was cancelled before it completed normally.
|
pure virtual |
Returns.
if this task completed.
Completion may be due to normal termination, an exception, or cancellation – in all of these cases, this method will return
.