RepeatedTaskManager

class RepeatedTaskManager @JvmOverloads constructor(meterRegistry: MeterRegistry = Metrics.globalRegistry)

Basic management of repeated tasks.

Constructors

Link copied to clipboard
constructor(meterRegistry: MeterRegistry = Metrics.globalRegistry)

Functions

Link copied to clipboard
fun createTask(name: String, meterRegistry: MeterRegistry = this.meterRegistry, repeatedTaskConfig: RepeatedTaskConfig = RepeatedTaskConfig(), retryPolicy: suspend RetryFailure<Throwable>.() -> RetryInstruction = defaultThrowableRetryPolicy + binaryExponentialBackoff( base = repeatedTaskConfig.defaultJitterMs, max = repeatedTaskConfig.defaultMaxDelayMs ), taskConfig: TaskConfig = TaskConfig(), task: (name: String, taskConfig: TaskConfig) -> Status): RepeatedTask

Creates the repeated task with the details supplied. If the repeated task already exists, a TaskAlreadyExistsException is thrown.

Link copied to clipboard
fun getTask(taskName: String): RepeatedTask
Link copied to clipboard
fun isTaskRunning(taskName: String): Boolean

Returns true if a repeated task with the name supplied is running. If the task does not exist or is not running, return false.

Link copied to clipboard
fun shutDown()
Link copied to clipboard
fun taskExists(taskName: String): Boolean