Quantum v2.3.4 Quantum.Storage.Adapter behaviour View Source

Bahaviour to be implemented by all Storage Adapters.

WARNING: This Adapter is experimental and will therefore not adhere to semantic versioning. It could undergo massive changes even in patch releases.

Link to this section Summary

Types

The expected return is :ok, every other result will terminate the scheduler

The calling scheduler Module

Callbacks

Save new job in storage

Delete new job in storage

Load saved jobs from storage

Load last execution time from storage

Purge all date from storage and go back to initial state

Change Job State from given job

Link to this section Types

The expected return is :ok, every other result will terminate the scheduler.

Link to this type scheduler_module() View Source
scheduler_module() :: atom()

The calling scheduler Module

Link to this section Callbacks

Link to this callback add_job(scheduler_module, job) View Source
add_job(scheduler_module(), job :: Quantum.Job.t()) :: ok()

Save new job in storage.

Link to this callback delete_job(scheduler_module, job) View Source
delete_job(scheduler_module(), job :: Quantum.Job.name()) :: ok()

Delete new job in storage.

Link to this callback jobs(scheduler_module) View Source
jobs(scheduler_module()) :: :not_applicable | [Quantum.Job.t()]

Load saved jobs from storage

Returns :not_applicable if the storage has never received an add_job call or after it has been purged. In this case the jobs from the configuration weill be loaded.

Link to this callback last_execution_date(scheduler_module) View Source
last_execution_date(scheduler_module()) :: :unknown | NaiveDateTime.t()

Load last execution time from storage

Returns :unknown if the storage does not know the last execution time. In this case all jobs will be run at the next applicable date.

Link to this callback purge(scheduler_module) View Source
purge(scheduler_module()) :: ok()

Purge all date from storage and go back to initial state.

Link to this callback update_job_state(scheduler_module, job, state) View Source
update_job_state(
  scheduler_module(),
  job :: Quantum.Job.name(),
  state :: Quantum.Job.state()
) :: ok()

Change Job State from given job.

Link to this callback update_last_execution_date(scheduler_module, last_execution_date) View Source
update_last_execution_date(
  scheduler_module(),
  last_execution_date :: NaiveDateTime.t()
) :: ok()

Update last execution time to given date.