Starts the processes of every mount of a host router when the host boots.
By default, a mount's processes (PhoenixMountable.children/1) start the
first time the mount is used: the first request or LiveView. That suits
caches and per-user state, but a scheduler or a poller would not run until
someone opens the library. A host that wants them running from boot adds
this supervisor to its application, after its repo and endpoint:
children = [
MyApp.Repo,
MyAppWeb.Endpoint,
{PhoenixMountable.Supervisor, router: MyAppWeb.Router, endpoint: MyAppWeb.Endpoint}
]The router knows its mounts at compile time, so nothing else is listed. The processes then live in the host's supervision tree, under the host's restart rules.
Options
:router(required) — the host router.:endpoint— the host endpoint, set asmount.endpointfor the processes (needed byPhoenixMountable.PubSubwithout a:pubsuboption).:name— the supervisor name.
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.