public class GracefulReconnect
GracefulReconnect provides the opportunity to perform certain logic when the RPC encounters a connection disconnect during communication with the node.
NOTE: The callbacks provided may be executed on a separate thread to that which called the RPC command.
Constructor and Description |
---|
GracefulReconnect(Function0<Unit> onDisconnect,
Function0<Unit> onReconnect,
int maxAttempts)
GracefulReconnect provides the opportunity to perform certain logic when the RPC encounters a connection disconnect
during communication with the node.
|
GracefulReconnect()
GracefulReconnect provides the opportunity to perform certain logic when the RPC encounters a connection disconnect
during communication with the node.
|
GracefulReconnect(java.lang.Runnable onDisconnect,
java.lang.Runnable onReconnect,
int maxAttempts) |
Modifier and Type | Method and Description |
---|---|
int |
getMaxAttempts()
the maximum number of attempts per each individual RPC call.
|
Function0<Unit> |
getOnDisconnect()
implement this callback to perform logic when the RPC disconnects on connection disconnect
|
Function0<Unit> |
getOnReconnect()
implement this callback to perform logic when the RPC has reconnected after connection disconnect
|
public GracefulReconnect(Function0<Unit> onDisconnect, Function0<Unit> onReconnect, int maxAttempts)
GracefulReconnect provides the opportunity to perform certain logic when the RPC encounters a connection disconnect during communication with the node.
NOTE: The callbacks provided may be executed on a separate thread to that which called the RPC command.
onDisconnect
- implement this callback to perform logic when the RPC disconnects on connection disconnectonReconnect
- implement this callback to perform logic when the RPC has reconnected after connection disconnectmaxAttempts
- the maximum number of attempts per each individual RPC call. A negative number indicates infinite number of retries. The default value is 5.onDisconnect
- implement this callback to perform logic when the RPC disconnects on connection disconnectonReconnect
- implement this callback to perform logic when the RPC has reconnected after connection disconnectmaxAttempts
- the maximum number of attempts per each individual RPC call. A negative number indicates infinite
number of retries. The default value is 5.public GracefulReconnect()
GracefulReconnect provides the opportunity to perform certain logic when the RPC encounters a connection disconnect during communication with the node.
NOTE: The callbacks provided may be executed on a separate thread to that which called the RPC command.
public GracefulReconnect(java.lang.Runnable onDisconnect, java.lang.Runnable onReconnect, int maxAttempts)
public Function0<Unit> getOnDisconnect()
implement this callback to perform logic when the RPC disconnects on connection disconnect
public Function0<Unit> getOnReconnect()
implement this callback to perform logic when the RPC has reconnected after connection disconnect
public int getMaxAttempts()
the maximum number of attempts per each individual RPC call.
A negative number indicates infinite number of retries. The default value is 5.