TimeoutTimer

class TimeoutTimer(dispatchQueue: DispatchQueue, callback: () -> Unit, timerCalculation: (tries: Int) -> Long)

A Timer class that schedules a callback to be called in the future. Can be configured to use a custom retry pattern, such as exponential backoff.

Constructors

TimeoutTimer
Link copied to clipboard
fun TimeoutTimer(dispatchQueue: DispatchQueue, callback: () -> Unit, timerCalculation: (tries: Int) -> Long)

Functions

reset
Link copied to clipboard
fun reset()
Resets the Timer, clearing the number of current tries and stops any scheduled timeouts.
scheduleTimeout
Link copied to clipboard
fun scheduleTimeout()
Cancels any previous timeouts and scheduled a new one