mule/runtime/midwife
Dynamic queue lifecycle — a port of Oban.Midwife: starts every
configured queue at boot, then starts/stops queues cluster-wide on
start/stop signals.
Divergence from midwife.ex: no notifier-monitor/resubscribe loop — the root supervisor is RestForOne with the notifier ahead of the nursery, so a notifier crash restarts the midwife, which re-subscribes in its initialiser (the port’s established notifier-recovery pattern).
gleam_otp constraint: factory supervisors have no unique child keys (no
via-tuples), so the registry’s {:queue, q} row supplies the
already_started dedup that Elixir gets from Registry names.
Types
The instance foreman’s registered name, threaded from mule.start —
gleam_otp names cannot be derived from strings at lookup time, so the
process.Name travels by argument where Elixir uses a via-tuple.
pub type ForemanName =
process.Name(
factory_supervisor.Message(queue_supervisor.QueueOptions, Nil),
)
pub type Message {
NotificationReceived(notifier.Notification)
}
Constructors
-
NotificationReceived(notifier.Notification)
Values
pub fn start(
config config: config.Config,
foreman_name foreman_name: process.Name(
factory_supervisor.Message(queue_supervisor.QueueOptions, Nil),
),
) -> Result(
actor.Started(process.Subject(Message)),
actor.StartError,
)