GenDurable.Supervisor (gen_durable v0.1.2)

Copy Markdown View Source

Top-level engine supervisor. Started by the host (Oban-style) as {GenDurable, opts} in their own supervision tree.

Options

  • :repo — the host's Ecto.Repo (required).
  • :fsms — FSM modules to register explicitly (default []). Only needed for a custom :name or to keep an old :version running; otherwise a machine is resolved from the fsm column (its module name). See GenDurable.Registry.
  • :queues — keyword list of queue_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).
  • :prefetch — extra rows each queue claims and buffers beyond its running slots (default 0 ⇒ no over-fetch). See GenDurable.Scheduler.
  • :min_demand — batch gate for the picker (default 1).
  • :max_poll_interval — idle-backoff ceiling in ms (default 5_000).
  • :drain_timeout — on shutdown, how long (ms) each queue waits for its in-flight steps to finish before giving up to the reaper (default 5_000). Buffered (un-started) rows are released immediately regardless.

: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

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)