Durable.Wait.SleepWaker (Durable v0.1.0-rc)
View SourceBackground worker that revives workflows whose sleep/1 or
schedule_at/1 wait has elapsed.
When a step body calls sleep or schedule_at, the executor flips the
workflow to :waiting and stamps scheduled_at. This worker
periodically asks the queue adapter to flip any such row back to
:pending once scheduled_at <= NOW(), so the queue poller can
re-claim it. The adapter also merges a :__sleep_satisfied__ marker
into the workflow's context so the step body's next sleep call
returns immediately rather than re-throwing.
Polls every :sleep_waker_interval milliseconds (default 1_000) and
wakes up to :sleep_waker_batch_size workflows per tick (default
- — both configurable via
Durable.Config.
Summary
Functions
Returns a specification to start this module under a supervisor.
Starts the sleep waker.
Manually triggers a sweep, returning {:ok, woken_count}.
Returns the process name for a given Durable instance.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Starts the sleep waker.
Options
:config- The Durable config (required):interval- Override the config's:sleep_waker_interval(optional):batch_size- Override the config's:sleep_waker_batch_size(optional)
Manually triggers a sweep, returning {:ok, woken_count}.
Useful in tests and operational tooling — the periodic timer keeps ticking independently.
Returns the process name for a given Durable instance.