# `Drizzle`

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

# `t`

```elixir
@type t() :: %Drizzle{
  evaluation_time_fun: (integer() -&gt; any()),
  last_evaluation: integer() | nil | (-&gt; integer() | nil),
  records: [Drizzle.Record.t()],
  wait_for_update: nil | true | false
}
```

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.
- `:wait_for_update` - Does not evaluate or catch up before `update/1` is called. Useful for dynamic configuration.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `init`

# `start_link`

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

# `update`

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

Update the crontab during runtime.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
