clockwork/schedule

Types

pub type Message {
  Run
  Stop
}

Constructors

  • Run
  • Stop
pub type Schedule {
  Schedule(subject: process.Subject(Message))
}

Constructors

  • Schedule(subject: process.Subject(Message))
pub opaque type Scheduler

Functions

pub fn new(id: String, cron: Cron, job: fn() -> Nil) -> Scheduler
pub fn start(
  scheduler: Scheduler,
) -> Result(Schedule, StartError)
pub fn stop(schedule: Schedule) -> Nil
pub fn with_logging(scheduler: Scheduler) -> Scheduler
pub fn with_telemetry(scheduler: Scheduler) -> Scheduler
pub fn with_time_offset(
  scheduler: Scheduler,
  offset: Duration,
) -> Scheduler
Search Document