class ExponentialBackOffTimer : Timer
Extension of the Java Timer util class that schedules tasks with exponential backoff, as well as the ability to cancel the currently running task as well as future scheduled tasks. It also enables asynchronous cancellation
Creation of the timer is facilitated via the scheduleAndRun method
ExponentialBackOffTimer(ctx: <ERROR CLASS>)
Extension of the Java Timer util class that schedules tasks with exponential backoff, as well as the ability to cancel the currently running task as well as future scheduled tasks. It also enables asynchronous cancellation |
val ctx: <ERROR CLASS> |
fun cancel(): Unit
Terminates this timer, discarding any currently scheduled tasks, as well as cancelling the currently executing task. This blocks until the timer and any executing tasks are cancelled, as opposed to the asynchronous version cancelAsync |
|
fun cancelAsync(): CompletableFuture<*>
Returns a future for the termination of this timer |
fun scheduleAndRun(taskDescription: String, executionDelayMillis: Long, timeoutMillis: Long, maxRetries: Int? = null, maxBackoffTimeMillis: Long? = null, ctx: <ERROR CLASS>, task: () -> Unit): ExponentialBackOffTimer |