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
Modifier and Type Method Description longgetTimeoutNs(RedisCommand<?,?,?> command)Returns the timeout inTimeUnit.NANOSECONDSforRedisCommand.
-
Constructor Details
-
TimeoutProvider
public TimeoutProvider(Supplier<TimeoutOptions> timeoutOptionsSupplier, LongSupplier defaultTimeoutNsSupplier)- Parameters:
timeoutOptionsSupplier- must not benull.defaultTimeoutNsSupplier- must not benull.
-
-
Method Details
-
getTimeoutNs
Returns the timeout inTimeUnit.NANOSECONDSforRedisCommand.- Parameters:
command- the command.- Returns:
- timeout in
TimeUnit.NANOSECONDS.
-