Tasque.Supervisor (Tasque v1.0.0)
View SourceInternal supervisor that manages the process pair for a single Tasque
instance: a Task.Supervisor and a Tasque.Queue GenServer.
Internal module
This module is not part of the public API. Use {Tasque, opts} in your
supervision tree instead of starting this module directly.
Supervision Strategy
Uses :one_for_all — if either the Task.Supervisor or the
Tasque.Queue crashes, both are restarted together. This is necessary
because:
- If the
Task.Supervisorcrashes, all in-flight tasks are lost and the queue's:pending_refsmap would reference dead processes - If the
Tasque.Queuecrashes, the mapping between task refs and callers is lost, so in-flight task results could never be delivered
Restarting both ensures the system returns to a clean, consistent state.
Child Order
The Task.Supervisor is started before the Tasque.Queue so that
its registered name is available during queue initialization.
Process Naming
Given a Tasque instance named MyApp.Queue, the following processes
are registered:
| Process | Registered Name |
|---|---|
Tasque.Supervisor | MyApp.Queue.Supervisor |
Task.Supervisor | MyApp.Queue.TaskSupervisor |
Tasque.Queue | MyApp.Queue |
For {:global, term} and {:via, module, term} queue names, Tasque uses
the same naming strategy for its companion supervisor processes.
Summary
Functions
Returns a specification to start this module under a supervisor.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.