java.lang.Object
io.lettuce.core.LettuceFutures
public class LettuceFutures extends Object
Utility to
awaitAll(long, TimeUnit, Future[]) futures until they are done and to synchronize future execution using
awaitOrCancel(RedisFuture, long, TimeUnit).- Since:
- 3.0
- Author:
- Mark Paluch
-
Method Summary
Modifier and Type Method Description static booleanawaitAll(long timeout, TimeUnit unit, Future<?>... futures)Wait until futures are complete or the supplied timeout is reached.static booleanawaitAll(Duration timeout, Future<?>... futures)Wait until futures are complete or the supplied timeout is reached.static <T> TawaitOrCancel(RedisFuture<T> cmd, long timeout, TimeUnit unit)Wait until futures are complete or the supplied timeout is reached.
-
Method Details
-
awaitAll
Wait until futures are complete or the supplied timeout is reached. Commands are not canceled (in contrast toawaitOrCancel(RedisFuture, long, TimeUnit)) when the timeout expires.- Parameters:
timeout- Maximum time to wait for futures to complete.futures- Futures to wait for.- Returns:
trueif all futures complete in time, otherwisefalse- Since:
- 5.0
-
awaitAll
Wait until futures are complete or the supplied timeout is reached. Commands are not canceled (in contrast toawaitOrCancel(RedisFuture, long, TimeUnit)) when the timeout expires.- Parameters:
timeout- Maximum time to wait for futures to complete.unit- Unit of time for the timeout.futures- Futures to wait for.- Returns:
trueif all futures complete in time, otherwisefalse
-
awaitOrCancel
Wait until futures are complete or the supplied timeout is reached. Commands are canceled if the timeout is reached but the command is not finished.- Type Parameters:
T- Result type- Parameters:
cmd- Command to wait fortimeout- Maximum time to wait for futures to completeunit- Unit of time for the timeout- Returns:
- Result of the command.
-