java.lang.Object
io.lettuce.core.TimeoutOptions.Builder
- Enclosing class:
- TimeoutOptions
public static class TimeoutOptions.Builder extends Object
Builder for
TimeoutOptions.-
Constructor Summary
Constructors Constructor Description Builder() -
Method Summary
Modifier and Type Method Description TimeoutOptionsbuild()Create a new instance ofTimeoutOptions.TimeoutOptions.BuilderconnectionTimeout()Configure aTimeoutOptions.TimeoutSourcethat applies timeouts configured on the connection/client instance.TimeoutOptions.BuilderfixedTimeout(Duration duration)Set a fixed timeout for all commands.TimeoutOptions.BuildertimeoutCommands()Enable command timeouts.TimeoutOptions.BuildertimeoutCommands(boolean enabled)Configure whether commands should timeout.TimeoutOptions.BuildertimeoutSource(TimeoutOptions.TimeoutSource source)Set aTimeoutOptions.TimeoutSourceto obtain the timeout value perRedisCommand.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
timeoutCommands
Enable command timeouts. Disabled by default, seeTimeoutOptions.DEFAULT_TIMEOUT_COMMANDS.- Returns:
this
-
timeoutCommands
Configure whether commands should timeout. Disabled by default, seeTimeoutOptions.DEFAULT_TIMEOUT_COMMANDS.- Parameters:
enabled-trueto enable timeout;falseto disable timeouts.- Returns:
this
-
fixedTimeout
Set a fixed timeout for all commands.- Parameters:
duration- the timeoutDuration, must not benull.- Returns:
this
-
connectionTimeout
Configure aTimeoutOptions.TimeoutSourcethat applies timeouts configured on the connection/client instance.- Returns:
this
-
timeoutSource
Set aTimeoutOptions.TimeoutSourceto obtain the timeout value perRedisCommand.- Parameters:
source- the timeout source.- Returns:
this
-
build
Create a new instance ofTimeoutOptions.- Returns:
- new instance of
TimeoutOptions
-