loopingTry

open suspend fun <R> loopingTry(type: String, resetBlock: suspend () -> Unit = {}, block: suspend () -> R): R

Runs block, retrying every period set by waitUntilReconnect until the operation succeeds.

Parameters

type

The nature of connection, e.g. queue poll, subscribe.

resetBlock

Actions to reset the internal state upon a connection failure. This will be executed immediately after the operation fails.

block

Main logic to try executing.