DEFAULT_REQUEST_RETRY_COUNT

const val DEFAULT_REQUEST_RETRY_COUNT: Int = 3

Execute a request from the requestBlock and handle some of the Exception it could generate Ref: https://github.com/matrix-org/matrix-js-sdk/blob/develop/src/scheduler.js#L138-L175

Parameters

DATA

type of data return by the requestBlock

globalErrorReceiver

will be use to notify error such as invalid token error. See GlobalError

canRetry

if set to true, the request will be executed again in case of error, after a delay

maxDelayBeforeRetry

the max delay to wait before a retry. Note that in the case of a 429, if the provided delay exceeds this value, the error will be propagated as it does not make sense to retry it with a shorter delay.

maxRetriesCount

the max number of retries

requestBlock

a suspend lambda to perform the network request