Long Polling Config
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
delay Millis
delay between each request
max Request Count
maximum number of requests to be sent, null = no limit
stop On First Request Error
stop long polling on first error
on Transaction State
function called every time there is a successful response from server with current TransactionState of transaction
on Request Error
function called when unexpected error occurs (server or client side)
on Max Request Count
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 = { })