Scheduler Contract

Scheduler is the contract of task schedulers that allow for scheduling tasks.

Note
Kafka Server and Periodic Tasks describes the scheduled tasks.
package kafka.utils

trait Scheduler {
  def isStarted: Boolean
  def shutdown()
  def schedule(
    name: String,
    fun: () => Unit,
    delay: Long = 0,
    period: Long = -1,
    unit: TimeUnit = TimeUnit.MILLISECONDS)
  def startup()
}
Table 1. Scheduler Contract
Property Description

isStarted

Flag that indicates whether the scheduler has been started or not

Used when:

shutdown

Shuts down the scheduler. When this method is complete no more executions of background tasks will occur.

Used when:

schedule

Schedules a task

Used when:

startup

Initializes the scheduler so it is ready to schedule tasks

Used when:

Note
KafkaScheduler is the one and only known implementation of the Scheduler Contract in Apache Kafka.

results matching ""

    No results matching ""