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.
public GracefulReconnect(@NotNull
kotlin.jvm.functions.Function0<kotlin.Unit> onDisconnect,
@NotNull
kotlin.jvm.functions.Function0<kotlin.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.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.
@JvmOverloads
public GracefulReconnect(@NotNull
java.lang.Runnable onDisconnect,
@NotNull
java.lang.Runnable onReconnect,
int maxAttempts)
@JvmOverloads
public GracefulReconnect(@NotNull
java.lang.Runnable onDisconnect,
@NotNull
java.lang.Runnable onReconnect)
@NotNull public kotlin.jvm.functions.Function0<kotlin.Unit> getOnDisconnect()
implement this callback to perform logic when the RPC disconnects on connection disconnect
@NotNull public kotlin.jvm.functions.Function0<kotlin.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.