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

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

Functions

Link copied to clipboard
fun reset()

Resets the Timer, clearing the number of current tries and stops any scheduled timeouts.

Link copied to clipboard

Cancels any previous timeouts and scheduled a new one