public class TransactionOptions extends Object
Modifier and Type | Method and Description |
---|---|
static TransactionOptions |
defaults() |
long |
getResponseTimeout() |
int |
getRetryAttempts() |
long |
getRetryInterval() |
long |
getSyncTimeout() |
long |
getTimeout() |
TransactionOptions |
responseTimeout(long timeout,
TimeUnit unit)
Defines timeout for Redis response.
|
TransactionOptions |
retryAttempts(int retryAttempts)
Defines attempts amount to send transaction
if it hasn't been sent already.
|
TransactionOptions |
retryInterval(long retryInterval,
TimeUnit retryIntervalUnit)
Defines time interval for each attempt to send transaction
if it hasn't been sent already.
|
TransactionOptions |
syncSlavesTimeout(long syncTimeout,
TimeUnit syncUnit)
Synchronization data timeout between Redis master participating in transaction and its slaves.
|
TransactionOptions |
timeout(long timeout,
TimeUnit timeoutUnit)
If transaction hasn't been committed within
timeout it will rollback automatically. |
public static TransactionOptions defaults()
public long getResponseTimeout()
public TransactionOptions responseTimeout(long timeout, TimeUnit unit)
Default is 3000 milliseconds
timeout
- valueunit
- valuepublic int getRetryAttempts()
public TransactionOptions retryAttempts(int retryAttempts)
Default is 3 attempts
retryAttempts
- valuepublic long getRetryInterval()
public TransactionOptions retryInterval(long retryInterval, TimeUnit retryIntervalUnit)
Default is 1500 milliseconds
retryInterval
- - time intervalretryIntervalUnit
- - time interval unitpublic TransactionOptions syncSlavesTimeout(long syncTimeout, TimeUnit syncUnit)
Default is 5000 milliseconds
syncTimeout
- - synchronization timeoutsyncUnit
- - synchronization timeout time unitpublic long getSyncTimeout()
public long getTimeout()
public TransactionOptions timeout(long timeout, TimeUnit timeoutUnit)
timeout
it will rollback automatically.
Set -1
to disable.
Default is 5000 milliseconds
timeout
- in millisecondstimeoutUnit
- timeout time unitCopyright © 2014–2018 The Redisson Project. All rights reserved.