Lightning.Adaptors.Supervisor (Lightning v2.19.0)
View SourceSupervises one instance of the adaptors subsystem: the cache, task
supervisor, invalidator, node monitor, channel broadcaster and the
HighlanderPG-wrapped scheduler.
Every child, cache, topic and lock name derives from the :name opt,
so several instances can run in one BEAM. Production starts one under
name: Lightning.Adaptors. The scheduler is a cluster singleton
registered under global_scheduler_name/1.
Summary
Functions
Cachex table name for the supervisor named name.
ChannelBroadcaster GenServer name for the supervisor named name.
Returns a specification to start this module under a supervisor.
PubSub topic carrying debounced adaptors_updated events for the
supervisor named name; see Lightning.Adaptors.subscribe_to_updates/1.
Starts an instance, or returns the running one. For entry points that may run either against a cold BEAM or inside the booted application.
Erases the instance's :persistent_term entry. Not called
automatically, since :persistent_term.erase/1 triggers a global GC.
:global Scheduler name for the supervisor named name; pass it to
GenServer.call/3 directly.
HighlanderPG supervisor name for the supervisor named name.
Invalidator GenServer name for the supervisor named name.
Postgres advisory-lock key for the supervisor named name.
NodeMonitor GenServer name for the supervisor named name.
Atom form of the Scheduler name for the supervisor named name. The
process itself registers under global_scheduler_name/1.
Returns the source (:npm | :local) of the supervisor named name.
PubSub topic carrying {:changed, name, source} events for the
supervisor named name.
Starts a supervisor instance.
Returns the strategy of the supervisor named name. Raises if no
supervisor has started under that name.
Task.Supervisor name for the supervisor named name.
Functions
Cachex table name for the supervisor named name.
ChannelBroadcaster GenServer name for the supervisor named name.
Returns a specification to start this module under a supervisor.
See Supervisor.
PubSub topic carrying debounced adaptors_updated events for the
supervisor named name; see Lightning.Adaptors.subscribe_to_updates/1.
Starts an instance, or returns the running one. For entry points that may run either against a cold BEAM or inside the booted application.
Erases the instance's :persistent_term entry. Not called
automatically, since :persistent_term.erase/1 triggers a global GC.
:global Scheduler name for the supervisor named name; pass it to
GenServer.call/3 directly.
HighlanderPG supervisor name for the supervisor named name.
Invalidator GenServer name for the supervisor named name.
@spec lock_key(atom()) :: non_neg_integer()
Postgres advisory-lock key for the supervisor named name.
NodeMonitor GenServer name for the supervisor named name.
Atom form of the Scheduler name for the supervisor named name. The
process itself registers under global_scheduler_name/1.
@spec source(atom()) :: :npm | :local
Returns the source (:npm | :local) of the supervisor named name.
PubSub topic carrying {:changed, name, source} events for the
supervisor named name.
@spec start_link(keyword()) :: Supervisor.on_start()
Starts a supervisor instance.
Options:
:name- every child name derives from it, defaulting toLightning.Adaptors.Config.default_instance/0:strategy-Lightning.Adaptors.Strategyimplementation, defaulting toLightning.Adaptors.Config.strategy/0:lock_key-HighlanderPGadvisory-lock key, defaulting tolock_key(name):refresh_interval- scheduler tick interval in milliseconds, defaulting toLightning.Adaptors.Config.refresh_interval/0:warn_when_empty- whether the scheduler warns when it boots on an empty catalogue that no timer will fill, defaulting toLightning.Adaptors.Config.warn_when_empty?/0:checked_at- forwarded to the scheduler; seeLightning.Adaptors.Scheduler.start_link/1
Returns the strategy of the supervisor named name. Raises if no
supervisor has started under that name.
Task.Supervisor name for the supervisor named name.