public final class RemoteInvocationOptions extends Object implements Serializable
Examples:
// 1 second ack timeout and 30 seconds execution timeout RemoteInvocationOptions options = RemoteInvocationOptions.defaults(); // no ack but 30 seconds execution timeout RemoteInvocationOptions options = RemoteInvocationOptions.defaults() .noAck(); // 1 second ack timeout then forget the result RemoteInvocationOptions options = RemoteInvocationOptions.defaults() .noResult(); // 1 minute ack timeout then forget about the result RemoteInvocationOptions options = RemoteInvocationOptions.defaults() .expectAckWithin(1, TimeUnit.MINUTES) .noResult(); // no ack and forget about the result (fire and forget) RemoteInvocationOptions options = RemoteInvocationOptions.defaults() .noAck() .noResult();
Constructor and Description |
---|
RemoteInvocationOptions(RemoteInvocationOptions copy) |
Modifier and Type | Method and Description |
---|---|
static RemoteInvocationOptions |
defaults()
Creates a new instance of RemoteInvocationOptions with opinionated defaults.
|
RemoteInvocationOptions |
expectAckWithin(long ackTimeoutInMillis)
Defines ACK timeout
|
RemoteInvocationOptions |
expectAckWithin(long ackTimeout,
TimeUnit timeUnit)
Defines ACK timeout
|
RemoteInvocationOptions |
expectResultWithin(long executionTimeoutInMillis)
Defines execution timeout
|
RemoteInvocationOptions |
expectResultWithin(long executionTimeout,
TimeUnit timeUnit)
Defines execution timeout
|
Long |
getAckTimeoutInMillis() |
Long |
getExecutionTimeoutInMillis() |
boolean |
isAckExpected() |
boolean |
isResultExpected() |
RemoteInvocationOptions |
noAck()
Specifies to not wait for ACK reply
|
RemoteInvocationOptions |
noResult()
Specifies to not wait for result
|
String |
toString() |
public RemoteInvocationOptions(RemoteInvocationOptions copy)
public static RemoteInvocationOptions defaults()
This is equivalent to:
new RemoteInvocationOptions() .expectAckWithin(1, TimeUnit.SECONDS) .expectResultWithin(30, TimeUnit.SECONDS)
public Long getAckTimeoutInMillis()
public Long getExecutionTimeoutInMillis()
public boolean isAckExpected()
public boolean isResultExpected()
public RemoteInvocationOptions expectAckWithin(long ackTimeoutInMillis)
ackTimeoutInMillis
- - timeout in millisecondspublic RemoteInvocationOptions expectAckWithin(long ackTimeout, TimeUnit timeUnit)
ackTimeout
- - timeouttimeUnit
- - timeout unitpublic RemoteInvocationOptions noAck()
public RemoteInvocationOptions expectResultWithin(long executionTimeoutInMillis)
executionTimeoutInMillis
- - timeout in millisecondspublic RemoteInvocationOptions expectResultWithin(long executionTimeout, TimeUnit timeUnit)
executionTimeout
- - timeouttimeUnit
- - timeout unitpublic RemoteInvocationOptions noResult()
Copyright © 2014–2020 Redisson. All rights reserved.