LongPollingConfig
data class LongPollingConfig( val delayMillis: Long, val maxRequestCount: Int? = null, val stopOnFirstRequestError: Boolean = false, val onTransactionState: (TransactionState) -> Unit, val onRequestError: (Exception) -> Unit, val onMaxRequestCount: () -> Unit = { })
Class responsible for storing long polling config
Parameters
delayMillis
delay between each request
maxRequestCount
maximum number of requests to be sent, null = no limit
stopOnFirstRequestError
stop long polling on first error
onTransactionState
function called every time there is a successful response from server with current TransactionState of transaction
onRequestError
function called when unexpected error occurs (server or client side)
onMaxRequestCount
function called when maxRequestCount is achieved
Constructors
Link copied to clipboard
fun LongPollingConfig( delayMillis: Long, maxRequestCount: Int? = null, stopOnFirstRequestError: Boolean = false, onTransactionState: (TransactionState) -> Unit, onRequestError: (Exception) -> Unit, onMaxRequestCount: () -> Unit = { })