Graceful Reconnect
class GracefulReconnect(val onDisconnect: () -> Unit = {}, val onReconnect: () -> Unit = {}, val maxAttempts: Int = 5)
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.
Parameters
on Disconnect
implement this callback to perform logic when the RPC disconnects on connection disconnect
on Reconnect
implement this callback to perform logic when the RPC has reconnected after connection disconnect
max Attempts
the maximum number of attempts per each individual RPC call. A negative number indicates infinite number of retries. The default value is 5.