Package com.gigaspaces.async.internal
Class CompoundFuture<T,R>
java.lang.Object
com.gigaspaces.async.internal.CompoundFuture<T,R>
- All Implemented Interfaces:
AsyncFuture<R>,AsyncFutureListener<T>,Future<R>
a future implementation used to aggregate results from multiple Futures. it uses a call back from
the single Futures to determine whether the action has completed.
- Since:
- 6.5
- Author:
- asy ronen
-
Constructor Summary
ConstructorsConstructorDescriptionCompoundFuture(AsyncFuture<T>[] futures, AsyncResultsReducer<T, R> reducer) CompoundFuture(AsyncFuture<T>[] futures, AsyncResultsReducer<T, R> reducer, AsyncResultFilter<T> moderator) -
Method Summary
Modifier and TypeMethodDescriptionbooleancancel(boolean mayInterruptIfRunning) get()booleanbooleanisDone()voidonResult(AsyncResult<T> result) A callback when a result of an async invocation arrives.voidsetListener(AsyncFutureListener<R> listener)
-
Constructor Details
-
CompoundFuture
-
CompoundFuture
public CompoundFuture(AsyncFuture<T>[] futures, AsyncResultsReducer<T, R> reducer, AsyncResultFilter<T> moderator)
-
-
Method Details
-
setListener
- Specified by:
setListenerin interfaceAsyncFuture<T>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceFuture<T>
-
isDone
public boolean isDone() -
get
- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionException
-
get
public R get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
onResult
Description copied from interface:AsyncFutureListenerA callback when a result of an async invocation arrives.- Specified by:
onResultin interfaceAsyncFutureListener<T>
-