public class LettuceFutures extends Object
awaitAll(long, TimeUnit, Future[])
futures until they are done and to synchronize future execution using
awaitOrCancel(RedisFuture, long, TimeUnit)
.Modifier and Type | Method and Description |
---|---|
static boolean |
awaitAll(Duration timeout,
Future<?>... futures)
Wait until futures are complete or the supplied timeout is reached.
|
static boolean |
awaitAll(long timeout,
TimeUnit unit,
Future<?>... futures)
Wait until futures are complete or the supplied timeout is reached.
|
static <T> T |
awaitOrCancel(RedisFuture<T> cmd,
long timeout,
TimeUnit unit)
Wait until futures are complete or the supplied timeout is reached.
|
public static boolean awaitAll(Duration timeout, Future<?>... futures)
awaitOrCancel(RedisFuture, long, TimeUnit)
) when the timeout expires. A timeout
value of zero or less
indicates to not time out.timeout
- maximum time to wait for futures to complete.futures
- futures to wait for.true
if all futures complete in time, otherwise false
.public static boolean awaitAll(long timeout, TimeUnit unit, Future<?>... futures)
awaitOrCancel(RedisFuture, long, TimeUnit)
) when the timeout expires. A timeout
value of zero or less
indicates to not time out.timeout
- maximum time to wait for futures to complete.unit
- unit of time for the timeout.futures
- futures to wait for.true
if all futures complete in time, otherwise false
.public static <T> T awaitOrCancel(RedisFuture<T> cmd, long timeout, TimeUnit unit)
timeout
value of zero or less indicates to not time out.T
- Result type.cmd
- command to wait for.timeout
- maximum time to wait for futures to complete.unit
- unit of time for the timeout.Copyright © 2020 lettuce.io. All rights reserved.