public 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) |
RemoteInvocationOptions |
expectAckWithin(long ackTimeout,
TimeUnit timeUnit) |
RemoteInvocationOptions |
expectResultWithin(long executionTimeoutInMillis) |
RemoteInvocationOptions |
expectResultWithin(long executionTimeout,
TimeUnit timeUnit) |
Long |
getAckTimeoutInMillis() |
Long |
getExecutionTimeoutInMillis() |
boolean |
isAckExpected() |
boolean |
isResultExpected() |
RemoteInvocationOptions |
noAck() |
RemoteInvocationOptions |
noResult() |
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)
public RemoteInvocationOptions expectAckWithin(long ackTimeout, TimeUnit timeUnit)
public RemoteInvocationOptions noAck()
public RemoteInvocationOptions expectResultWithin(long executionTimeoutInMillis)
public RemoteInvocationOptions expectResultWithin(long executionTimeout, TimeUnit timeUnit)
public RemoteInvocationOptions noResult()
Copyright © 2014–2017 The Redisson Project. All rights reserved.