Package org.redisson.api
Class RemoteInvocationOptions
java.lang.Object
org.redisson.api.RemoteInvocationOptions
- All Implemented Interfaces:
Serializable
RRemoteService invocation options.
Used to tune how RRemoteService will behave
in regard to the remote invocations acknowledgement
and execution timeout.
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();
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RemoteInvocationOptionsdefaults()Creates a new instance of RemoteInvocationOptions with opinionated defaults.expectAckWithin(long ackTimeoutInMillis) Defines ACK timeoutexpectAckWithin(long ackTimeout, TimeUnit timeUnit) Defines ACK timeoutexpectResultWithin(long executionTimeoutInMillis) Defines execution timeoutexpectResultWithin(long executionTimeout, TimeUnit timeUnit) Defines execution timeoutbooleanbooleannoAck()Specifies to not wait for ACK replynoResult()Specifies to not wait for resulttoString()
-
Constructor Details
-
RemoteInvocationOptions
-
-
Method Details
-
defaults
Creates a new instance of RemoteInvocationOptions with opinionated defaults.This is equivalent to:
new RemoteInvocationOptions() .expectAckWithin(1, TimeUnit.SECONDS) .expectResultWithin(30, TimeUnit.SECONDS)- Returns:
- RemoteInvocationOptions object
-
getAckTimeoutInMillis
-
getExecutionTimeoutInMillis
-
isAckExpected
public boolean isAckExpected() -
isResultExpected
public boolean isResultExpected() -
expectAckWithin
Defines ACK timeout- Parameters:
ackTimeoutInMillis- - timeout in milliseconds- Returns:
- RemoteInvocationOptions object
-
expectAckWithin
Defines ACK timeout- Parameters:
ackTimeout- - timeouttimeUnit- - timeout unit- Returns:
- RemoteInvocationOptions object
-
noAck
Specifies to not wait for ACK reply- Returns:
- RemoteInvocationOptions object
-
expectResultWithin
Defines execution timeout- Parameters:
executionTimeoutInMillis- - timeout in milliseconds- Returns:
- RemoteInvocationOptions object
-
expectResultWithin
Defines execution timeout- Parameters:
executionTimeout- - timeouttimeUnit- - timeout unit- Returns:
- RemoteInvocationOptions object
-
noResult
Specifies to not wait for result- Returns:
- RemoteInvocationOptions object
-
toString
-