R
- Type of the result for the future.public interface IgniteInternalFuture<R>
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> IgniteInternalFuture<T> |
chain(IgniteClosure<? super IgniteInternalFuture<R>,T> doneCb)
Make a chained future to convert result of this future (when complete) into a new format.
|
<T> IgniteInternalFuture<T> |
chain(IgniteClosure<? super IgniteInternalFuture<R>,T> doneCb,
Executor exec)
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.
|
Throwable |
error() |
R |
get()
Synchronously waits for completion of the computation and
returns computation result.
|
R |
get(long timeout)
Synchronously waits for completion of the computation for
up to the timeout specified and returns computation result.
|
R |
get(long timeout,
TimeUnit unit)
Synchronously waits for completion of the computation for
up to the timeout specified and returns computation result.
|
R |
getUninterruptibly()
Synchronously waits for completion of the computation and returns computation result ignoring interrupts.
|
boolean |
isCancelled()
Returns
true if this computation was cancelled before it completed normally. |
boolean |
isDone()
Checks if computation is done.
|
void |
listen(IgniteInClosure<? super IgniteInternalFuture<R>> lsnr)
Registers listener closure to be asynchronously notified whenever future completes.
|
R |
result() |
long |
startTime()
Gets start time for this future.
|
R get() throws IgniteCheckedException
IgniteInterruptedCheckedException
- Subclass of IgniteCheckedException
thrown if the wait was interrupted.IgniteFutureCancelledCheckedException
- Subclass of IgniteCheckedException
throws if computation was cancelled.IgniteCheckedException
- If computation failed.R get(long timeout) throws IgniteCheckedException
get(long, TimeUnit.MILLISECONDS)
.timeout
- The maximum time to wait in milliseconds.IgniteInterruptedCheckedException
- Subclass of IgniteCheckedException
thrown if the wait was interrupted.IgniteFutureTimeoutCheckedException
- Subclass of IgniteCheckedException
thrown if the wait was timed out.IgniteFutureCancelledCheckedException
- Subclass of IgniteCheckedException
throws if computation was cancelled.IgniteCheckedException
- If computation failed.R get(long timeout, TimeUnit unit) throws IgniteCheckedException
timeout
- The maximum time to wait.unit
- The time unit of the timeout
argument.IgniteInterruptedCheckedException
- Subclass of IgniteCheckedException
thrown if the wait was interrupted.IgniteFutureTimeoutCheckedException
- Subclass of IgniteCheckedException
thrown if the wait was timed out.IgniteFutureCancelledCheckedException
- Subclass of IgniteCheckedException
throws if computation was cancelled.IgniteCheckedException
- If computation failed.R getUninterruptibly() throws IgniteCheckedException
IgniteFutureCancelledCheckedException
- Subclass of IgniteCheckedException
throws if computation
was cancelled.IgniteCheckedException
- If computation failed.boolean cancel() throws IgniteCheckedException
True
if future was canceled (i.e. was not finished prior to this call).IgniteCheckedException
- If cancellation failed.boolean isDone()
True
if computation is done, false
otherwise.boolean isCancelled()
true
if this computation was cancelled before it completed normally.True
if this computation was cancelled before it completed normally.long startTime()
long duration()
void listen(IgniteInClosure<? super IgniteInternalFuture<R>> lsnr)
lsnr
- Listener closure to register. If not provided - this method is no-op.<T> IgniteInternalFuture<T> chain(IgniteClosure<? super IgniteInternalFuture<R>,T> doneCb)
doneCb
- Done callback that is applied to this future when it finishes to produce chained future result.<T> IgniteInternalFuture<T> chain(IgniteClosure<? super IgniteInternalFuture<R>,T> doneCb, Executor exec)
doneCb
- Done callback that is applied to this future when it finishes to produce chained future result.exec
- Executor to run callback.Throwable error()
R result()
Follow @ApacheIgnite
Ignite Fabric : ver. 1.9.0 Release Date : March 2 2017