java.lang.Object
io.lettuce.core.TimeoutOptions
- All Implemented Interfaces:
Serializable
public class TimeoutOptions extends Object implements Serializable
Options for command timeouts. This options configure how and whether commands time out once they were dispatched. Command
timeout begins:
- When the command is sent successfully to the transport
- Queued while the connection was inactive
- Since:
- 5.1
- Author:
- Mark Paluch
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTimeoutOptions.BuilderBuilder forTimeoutOptions.static classTimeoutOptions.TimeoutSourceSource for the actual timeout to expire a particularRedisCommand. -
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_TIMEOUT_COMMANDS -
Method Summary
Modifier and Type Method Description static TimeoutOptions.Builderbuilder()Returns a newTimeoutOptions.Builderto constructTimeoutOptions.static TimeoutOptionscreate()Create a new instance ofTimeoutOptionswith default settings.static TimeoutOptionsenabled()Create a new instance ofTimeoutOptionswith enabled timeout applying default connection timeouts.static TimeoutOptionsenabled(Duration timeout)Create a new instance ofTimeoutOptionswith enabled timeout applying a fixedtimeout.TimeoutOptions.TimeoutSourcegetSource()booleanisApplyConnectionTimeout()booleanisTimeoutCommands()
-
Field Details
-
DEFAULT_TIMEOUT_COMMANDS
public static final boolean DEFAULT_TIMEOUT_COMMANDS- See Also:
- Constant Field Values
-
-
Method Details
-
builder
Returns a newTimeoutOptions.Builderto constructTimeoutOptions.- Returns:
- a new
TimeoutOptions.Builderto constructTimeoutOptions.
-
create
Create a new instance ofTimeoutOptionswith default settings.- Returns:
- a new instance of
TimeoutOptionswith default settings.
-
enabled
Create a new instance ofTimeoutOptionswith enabled timeout applying default connection timeouts.- Returns:
- a new instance of
TimeoutOptionswith enabled timeout applying default connection timeouts.
-
enabled
Create a new instance ofTimeoutOptionswith enabled timeout applying a fixedtimeout.- Returns:
- a new instance of
TimeoutOptionswith enabled timeout applying a fixedtimeout.
-
isTimeoutCommands
public boolean isTimeoutCommands()- Returns:
trueif commands should time out.
-
isApplyConnectionTimeout
public boolean isApplyConnectionTimeout()- Returns:
trueto apply connection timeouts declared on connection level.
-
getSource
- Returns:
- the timeout source to determine the timeout for a
RedisCommand. Can benullifisTimeoutCommands()isfalse.
-