ETS-backed dispatch table for mob_wake.
Owns the identifier → {trigger, mfa, state} table used by
Mob.Wake.register/2, Mob.Wake.dispatch/1, and Mob.Wake.status/1.
Reads go directly to ETS (public, read-concurrency on) so
dispatch/1 is fast on the hot path. Writes go through the GenServer
so registration is serialised and can validate opts. State updates
(:last_fired_at, :state) after each dispatch go through the
GenServer too — one owner keeps the concurrent-write story simple.
This module is @moduledoc false-adjacent — it's public for the
plugin's own supervision tree but users should reach for Mob.Wake,
not touch this directly.
Seeded at start from Application.get_env(:mob_wake, :tasks, []) —
the compile-time task table each host declares in mob.exs.
Summary
Functions
All currently registered tasks.
Returns a specification to start this module under a supervisor.
Look up a registered task.
Register or replace a task's identifier → MFA mapping.
Start the registry, seeding from config :mob_wake, :tasks.
Update a task's :state, :last_fired_at, :next_eligible_fire fields.
Types
@type entry() :: {atom(), MobWake.trigger(), {module(), atom()} | {module(), atom(), [any()]}, map()}
A registered task: {identifier, trigger, mfa, state}.
identifier— the atom the OS-side handler names when it fires.trigger—:refresh | :processing | :push.mfa—{module, function}or{module, function, extra_args}.extra_argsis prepended to the invocation's dispatch payload.state— mutable per-entry metadata (:state,:last_fired_at,:next_eligible_fire) updated after each dispatch.
Functions
@spec all() :: [entry()]
All currently registered tasks.
Returns a specification to start this module under a supervisor.
See Supervisor.
Look up a registered task.
Direct ETS read — safe on the hot path from concurrent processes.
Returns {:ok, entry} or :error.
Register or replace a task's identifier → MFA mapping.
@spec start_link(keyword()) :: GenServer.on_start()
Start the registry, seeding from config :mob_wake, :tasks.
Update a task's :state, :last_fired_at, :next_eligible_fire fields.