Kathikon.Scheduler.Behaviour behaviour (Kathikon v0.2.1)

Copy Markdown View Source

Behaviour for scheduling adapters.

Quantum owns clock-based triggering; Kathikon owns durable work.

Summary

Callbacks

cancel_schedule(term)

@callback cancel_schedule(term()) :: :ok | {:error, term()}

fetch_schedule(term)

@callback fetch_schedule(term()) :: {:ok, map()} | {:error, term()}

list_schedules(keyword)

@callback list_schedules(keyword()) :: {:ok, [map()]} | {:error, term()}

schedule_once(module, term, keyword)

@callback schedule_once(module(), term(), keyword()) :: {:ok, term()} | {:error, term()}

schedule_recurring(module, term, keyword)

@callback schedule_recurring(module(), term(), keyword()) ::
  {:ok, term()} | {:error, term()}

update_schedule(term, keyword)

@callback update_schedule(
  term(),
  keyword()
) :: {:ok, map()} | {:error, term()}