Interface AsyncExecutions<T>
-
- 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
All Methods Instance Methods Abstract Methods Default Methods 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 newCompletionStage
that, 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, 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, whenCompleteAsync
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
asMap
Map<RedisClusterNode,CompletableFuture<T>> asMap()
- Returns:
- map between
RedisClusterNode
and theCompletionStage
-
nodes
Collection<RedisClusterNode> nodes()
- Returns:
- collection of nodes on which the command was executed.
-
get
CompletionStage<T> get(RedisClusterNode redisClusterNode)
- Parameters:
redisClusterNode
- the node- Returns:
- the completion stage for this node
-
futures
CompletableFuture<T>[] futures()
- Returns:
- array of futures.
-
thenCollect
<R,A> CompletionStage<R> thenCollect(Collector<? super T,A,R> collector)
Returns a newCompletionStage
that, when this stage completes normally, is executed with this stage's results as the argument to theCollector
. See theCompletionStage
documentation for rules covering exceptional completion.- Parameters:
collector
- theCollector
to collect this stages results.- Returns:
- the new
CompletionStage
.
-
stream
default Stream<CompletableFuture<T>> stream()
- Returns:
- a sequential
Stream
over theCompletionStages
in this collection
-
-