Class LettuceFutures

    • Method Detail

      • awaitAll

        public static boolean awaitAll​(Duration timeout,
                                       Future<?>... futures)
        Wait until futures are complete or the supplied timeout is reached. Commands are not canceled (in contrast to awaitOrCancel(RedisFuture, long, TimeUnit)) when the timeout expires.
        Parameters:
        timeout - Maximum time to wait for futures to complete.
        futures - Futures to wait for.
        Returns:
        true if all futures complete in time, otherwise false
        Since:
        5.0
      • awaitAll

        public static boolean awaitAll​(long timeout,
                                       TimeUnit unit,
                                       Future<?>... futures)
        Wait until futures are complete or the supplied timeout is reached. Commands are not canceled (in contrast to awaitOrCancel(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:
        true if all futures complete in time, otherwise false
      • awaitOrCancel

        public static <T> T awaitOrCancel​(RedisFuture<T> cmd,
                                          long timeout,
                                          TimeUnit unit)
        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 for
        timeout - Maximum time to wait for futures to complete
        unit - Unit of time for the timeout
        Returns:
        Result of the command.