Top-level engine supervisor. Started by the host (Oban-style) as
{GenDurable, opts} in their own supervision tree.
Options
:name— the instance identity (an atom, defaultGenDurable). Everything an instance owns — its supervisor registration, task supervisor, config entry, FSM registry — is keyed by it, so several engines (e.g. different repos, or disjoint queue sets) coexist; address API calls withname:. Starting two instances with the same name fails with:already_started.:repo— the host'sEcto.Repo(required).:fsms— FSM modules to register explicitly (default[]). Only needed for a custom:nameor to keep an old:versionrunning; otherwise a machine is resolved from thefsmcolumn (its module name). SeeGenDurable.Registry.:queues— keyword list ofqueue_name => concurrency(default[default: 10]).:lease_ttl,:heartbeat_interval,:poll_interval,:reap_interval— timings in ms (Balanced defaults: 60_000 / 20_000 / 1_000 / 30_000).:gc_interval— ms between GC sweeps of terminal rows (default60_000). Set tonilto disable GC entirely (terminal rows then accumulate).:gc_retention— ms adone/failedrow is kept after it terminates before GC may delete it (default86_400_000, i.e. 1 day).:gc_batch— max rows deleted per GC sweep (default10_000).:prefetch— extra rows each queue claims and buffers beyond its running slots (default0⇒ no over-fetch). SeeGenDurable.Scheduler.:min_demand— batch gate for the picker (default1).:max_poll_interval— idle-backoff ceiling in ms (default5_000).:drain_timeout— on shutdown, how long (ms) each queue waits for its in-flight steps to finish before giving up to the reaper (default5_000). Buffered (un-started) rows are released immediately regardless.:rate_limits— named token-bucket rate limits (default[]), e.g.[stripe: [allowed: 100, period: {1, :minute}], emails: [allowed: 5, period: 60, burst: 10]].allowed/periodset the sustained rate;burst(defaultallowed) the capacity. A step opts into a limit by returningrate_limit: :stripe(or{:stripe, key}).
:prefetch, :min_demand, and :max_poll_interval are the feeder
aggressiveness knobs and apply to every queue; see GenDurable.Scheduler for
the trade-offs (DB chatter vs. latency vs. cross-node fairness).
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.