Package io.lettuce.core.internal
Class TimeoutProvider
- java.lang.Object
-
- io.lettuce.core.internal.TimeoutProvider
-
public class TimeoutProvider extends Object
Provider for command timeout durations. Determines an individual timeout for each command and falls back to a default timeout.- Since:
- 5.1
- Author:
- Mark Paluch
- See Also:
TimeoutOptions
-
-
Constructor Summary
Constructors Constructor Description TimeoutProvider(Supplier<TimeoutOptions> timeoutOptionsSupplier, LongSupplier defaultTimeoutNsSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getTimeoutNs(RedisCommand<?,?,?> command)
Returns the timeout inTimeUnit.NANOSECONDS
forRedisCommand
.
-
-
-
Constructor Detail
-
TimeoutProvider
public TimeoutProvider(Supplier<TimeoutOptions> timeoutOptionsSupplier, LongSupplier defaultTimeoutNsSupplier)
- Parameters:
timeoutOptionsSupplier
- must not benull
.defaultTimeoutNsSupplier
- must not benull
.
-
-
Method Detail
-
getTimeoutNs
public long getTimeoutNs(RedisCommand<?,?,?> command)
Returns the timeout inTimeUnit.NANOSECONDS
forRedisCommand
.- Parameters:
command
- the command.- Returns:
- timeout in
TimeUnit.NANOSECONDS
.
-
-