- All Superinterfaces:
CompletionStage<List<T>>,Iterable<CompletableFuture<T>>
public interface AsyncExecutions<T> extends Iterable<CompletableFuture<T>>, CompletionStage<List<T>>
Result holder for a command that was executed asynchronously on multiple nodes.
- Since:
- 4.0
- Author:
- Mark Paluch
-
Method Summary
Modifier and Type Method Description Map<RedisClusterNode,CompletableFuture<T>>asMap()CompletableFuture<T>[]futures()CompletionStage<T>get(RedisClusterNode redisClusterNode)Collection<RedisClusterNode>nodes()default Stream<CompletableFuture<T>>stream()<R, A> CompletionStage<R>thenCollect(Collector<? super T,A,R> collector)Returns a newCompletionStagethat, when this stage completes normally, is executed with this stage's results as the argument to theCollector.Methods inherited from interface java.util.concurrent.CompletionStage
acceptEither, acceptEitherAsync, acceptEitherAsync, applyToEither, applyToEitherAsync, applyToEitherAsync, exceptionally, exceptionallyAsync, exceptionallyAsync, exceptionallyCompose, exceptionallyComposeAsync, exceptionallyComposeAsync, handle, handleAsync, handleAsync, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, whenComplete, whenCompleteAsync, whenCompleteAsyncMethods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
asMap
Map<RedisClusterNode,CompletableFuture<T>> asMap()- Returns:
- map between
RedisClusterNodeand theCompletionStage
-
nodes
Collection<RedisClusterNode> nodes()- Returns:
- collection of nodes on which the command was executed.
-
get
- Parameters:
redisClusterNode- the node- Returns:
- the completion stage for this node
-
futures
CompletableFuture<T>[] futures()- Returns:
- array of futures.
-
thenCollect
Returns a newCompletionStagethat, when this stage completes normally, is executed with this stage's results as the argument to theCollector. See theCompletionStagedocumentation for rules covering exceptional completion.- Parameters:
collector- theCollectorto collect this stages results.- Returns:
- the new
CompletionStage.
-
stream
- Returns:
- a sequential
Streamover theCompletionStagesin this collection
-