Fledex.Animation.JobScheduler (fledex v0.7.0)

View Source

This module is a small wrapper around hte Fledex.Scheduler library and adds Fledex specific aspsects into the scheduler.

Note

You probably do not want to use this module directly but use the DSL defined in Fledex

A job scheduler

Summary

Types

The configuration of a job.

Functions

Changes the scheduling configuration of an already existing JobScheduler

starts a new JobScheduler with the given strip_name and job_name

converts a config to a job

Types

config_t()

@type config_t() :: %{
  type: :job,
  schedule: Fledex.Scheduler.Job.schedule(),
  options: keyword(),
  func: (-> any())
}

The configuration of a job.

  • :type: This must be :job
  • :schedule: This is the crontab pattern or interval describing when to trigger the job
  • :options: Some options to finetune the job :timezone: default UTC :overlap: whether jobs are allowed to overlap (if execution is longer than the interval between runs)
  • :func: The function that will be executed when the job runs.

job()

@type job() :: Fledex.Scheduler.Job.t()

Functions

change_config(server, job)

@spec change_config(GenServer.server(), job()) :: :ok

Changes the scheduling configuration of an already existing JobScheduler

start_link(strip_name, job_name, job, server_opts)

@spec start_link(atom(), atom(), job(), keyword()) :: GenServer.on_start()

starts a new JobScheduler with the given strip_name and job_name

to_job(strip_name, job_name, job_config)

@spec to_job(atom(), atom(), config_t()) :: job()

converts a config to a job