Scheduler Contract

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

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


Flag that indicates whether the scheduler has been started or not

Used when:


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

Used when:


Schedules a task

Used when:


Initializes the scheduler so it is ready to schedule tasks

Used when:

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

results matching ""

    No results matching ""