Executor

interface Executor : Disposable

Base interface for Scheduler executors. All tasks are executed synchronously one by one, never concurrently. Executors must be disposed when they are no longer needed.

Properties

Link copied to clipboard
abstract val isDisposed: Boolean

Checks whether this resource is disposed or not

Functions

Link copied to clipboard
abstract fun cancel()

Cancels all tasks. All running tasks will be interrupted, all pending tasks will not be executed.

Link copied to clipboard
abstract fun dispose()

Disposes this resource

Link copied to clipboard
abstract fun submit(delay: Duration = Duration.ZERO, period: Duration = Duration.INFINITE, task: () -> Unit)

Submits a new task, repeating if period is specified.