Durable.Queue.Worker (Durable v2.0.2)
View SourceExecutes a single workflow job in an isolated process.
Each worker runs under a DynamicSupervisor with restart: :temporary,
ensuring that:
- Each workflow execution is isolated
- A crash in one worker does not affect others
- Workers are not automatically restarted (stale lock recovery handles retries)
The worker spawns job execution in a separate Task, allowing the GenServer
to send periodic heartbeats to update locked_at and prevent stale lock
recovery from incorrectly reclaiming long-running jobs. It traps exits, so a
Task that dies (a linked process crashed, or something killed it) is an
attempt it can record rather than a crash that takes it down too.
Summary
Functions
Returns a specification to start this module under a supervisor.
Starts a worker process to execute a job.
Types
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec start_link(keyword()) :: GenServer.on_start()
Starts a worker process to execute a job.
Options
:job- The job map to execute (required):config- The Durable configuration (required):poller_pid- The poller process to report completion to (required)