V
- Type of the result for the future.public interface IgniteFuture<V> extends Future<V>
Future
interface. It adds simplified exception handling,
functional programming support and ability to listen for future completion via functional
callback.Modifier and Type | Method and Description |
---|---|
boolean |
cancel()
Cancels this future.
|
<T> IgniteFuture<T> |
chain(IgniteClosure<? super IgniteFuture<V>,T> doneCb)
Make a chained future to convert result of this future (when complete) into a new format.
|
long |
duration()
Gets duration in milliseconds between start of the future and current time if future
is not finished, or between start and finish of this future.
|
V |
get()
Synchronously waits for completion of the computation and
returns computation result.
|
V |
get(long timeout)
Synchronously waits for completion of the computation for
up to the timeout specified and returns computation result.
|
V |
get(long timeout,
TimeUnit unit)
Synchronously waits for completion of the computation for
up to the timeout specified and returns computation result.
|
void |
listen(IgniteInClosure<? super IgniteFuture<V>> lsnr)
Registers listener closure to be asynchronously notified whenever future completes.
|
long |
startTime()
Gets start time for this future.
|
cancel, isCancelled, isDone
V get() throws IgniteException
get
in interface Future<V>
IgniteInterruptedException
- Subclass of IgniteException
thrown if the wait was interrupted.IgniteFutureCancelledException
- Subclass of IgniteException
thrown if computation was cancelled.IgniteException
- If computation failed.V get(long timeout) throws IgniteException
get(long, TimeUnit.MILLISECONDS)
.timeout
- The maximum time to wait in milliseconds.IgniteInterruptedException
- Subclass of IgniteException
thrown if the wait was interrupted.IgniteFutureCancelledException
- Subclass of IgniteException
thrown if computation was cancelled.IgniteFutureTimeoutException
- Subclass of IgniteException
thrown if the wait was timed out.IgniteException
- If computation failed.V get(long timeout, TimeUnit unit) throws IgniteException
get
in interface Future<V>
timeout
- The maximum time to wait.unit
- The time unit of the timeout
argument.IgniteInterruptedException
- Subclass of IgniteException
thrown if the wait was interrupted.IgniteFutureCancelledException
- Subclass of IgniteException
thrown if computation was cancelled.IgniteFutureTimeoutException
- Subclass of IgniteException
thrown if the wait was timed out.IgniteException
- If computation failed.boolean cancel() throws IgniteException
True
if future was canceled (i.e. was not finished prior to this call).IgniteException
- If cancellation failed.long startTime()
long duration()
void listen(IgniteInClosure<? super IgniteFuture<V>> lsnr)
lsnr
- Listener closure to register. If not provided - this method is no-op.<T> IgniteFuture<T> chain(IgniteClosure<? super IgniteFuture<V>,T> doneCb)
doneCb
- Done callback that is applied to this future when it finishes to produce chained future result.
Follow @ApacheIgnite
Apache Ignite Fabric : ver. 1.0.0-RC3 Release Date : March 24 2015