Package io.lettuce.core
Class TimeoutOptions
- java.lang.Object
-
- io.lettuce.core.TimeoutOptions
-
- All Implemented Interfaces:
Serializable
public class TimeoutOptions extends Object implements Serializable
Options for command timeouts. These 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 class
TimeoutOptions.Builder
Builder forTimeoutOptions
.static class
TimeoutOptions.TimeoutSource
Source for the actual timeout to expire a particularRedisCommand
.
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEFAULT_TIMEOUT_COMMANDS
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TimeoutOptions.Builder
builder()
Returns a newTimeoutOptions.Builder
to constructTimeoutOptions
.static TimeoutOptions
create()
Create a new instance ofTimeoutOptions
with default settings.static TimeoutOptions
enabled()
Create a new instance ofTimeoutOptions
with enabled timeout applying default connection timeouts.static TimeoutOptions
enabled(Duration timeout)
Create a new instance ofTimeoutOptions
with enabled timeout applying a fixedtimeout
.TimeoutOptions.TimeoutSource
getSource()
boolean
isApplyConnectionTimeout()
boolean
isTimeoutCommands()
-
-
-
Field Detail
-
DEFAULT_TIMEOUT_COMMANDS
public static final boolean DEFAULT_TIMEOUT_COMMANDS
- See Also:
- Constant Field Values
-
-
Method Detail
-
builder
public static TimeoutOptions.Builder builder()
Returns a newTimeoutOptions.Builder
to constructTimeoutOptions
.- Returns:
- a new
TimeoutOptions.Builder
to constructTimeoutOptions
.
-
create
public static TimeoutOptions create()
Create a new instance ofTimeoutOptions
with default settings.- Returns:
- a new instance of
TimeoutOptions
with default settings.
-
enabled
public static TimeoutOptions enabled()
Create a new instance ofTimeoutOptions
with enabled timeout applying default connection timeouts.- Returns:
- a new instance of
TimeoutOptions
with enabled timeout applying default connection timeouts.
-
enabled
public static TimeoutOptions enabled(Duration timeout)
Create a new instance ofTimeoutOptions
with enabled timeout applying a fixedtimeout
.- Returns:
- a new instance of
TimeoutOptions
with enabled timeout applying a fixedtimeout
.
-
isTimeoutCommands
public boolean isTimeoutCommands()
- Returns:
true
if commands should time out.
-
isApplyConnectionTimeout
public boolean isApplyConnectionTimeout()
- Returns:
true
to apply connection timeouts declared on connection level.
-
getSource
public TimeoutOptions.TimeoutSource getSource()
- Returns:
- the timeout source to determine the timeout for a
RedisCommand
. Can benull
ifisTimeoutCommands()
isfalse
.
-
-