GracefulReconnect

constructor(onDisconnect: Runnable, onReconnect: Runnable, maxAttempts: Int = 5)


constructor(onDisconnect: () -> Unit = {}, onReconnect: () -> Unit = {}, maxAttempts: Int = 5)

Parameters

onDisconnect

implement this callback to perform logic when the RPC disconnects on connection disconnect

onReconnect

implement this callback to perform logic when the RPC has reconnected after connection disconnect

maxAttempts

the maximum number of attempts per each individual RPC call. A negative number indicates infinite number of retries. The default value is 5.