Drizzle (drizzle v0.1.0)

Copy Markdown

A server for second-granularity execution of jobs from a cron tab

Summary

Types

t()

The main struct for the Drizzle GenServer, managing job execution state.

Functions

Returns a specification to start this module under a supervisor.

Callback implementation for GenServer.init/1.

Update the crontab during runtime.

Types

t()

@type t() :: %Drizzle{
  evaluation_time_fun: (integer() -> any()),
  last_evaluation: integer(),
  records: [Drizzle.Record.t()]
}

The main struct for the Drizzle GenServer, managing job execution state.

Fields

  • :records – A list of Drizzle.Record structs, each defining a job to be executed according to its cron schedule.
  • :last_evaluation – The timestamp (in seconds) of the last evaluation cycle. Used to catch up on time spent offline.
  • :evaluation_time_fun – A function called after each execution and every 30s, used to perst the evaluation timestamp. Accepts the current timestamp (in seconds) as an argument.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

init(list)

Callback implementation for GenServer.init/1.

start_link(arg1)

@spec start_link([]) :: {:ok, pid()}
@spec start_link(t()) :: {:ok, pid()}

update(records)

@spec update([Drizzle.Record.t()]) :: :ok

Update the crontab during runtime.