The gateway daemon: pairing, a session DynamicSupervisor, and the router.
Strategy is :rest_for_one, so the router (which references the sessions
supervisor) restarts if that supervisor dies.
Options
:handler(required) --{module, opts}the sessions run. The supervisor does not start when the module cannot be loaded (seeSessionRouter):adapter/:deliver-- how outbound is delivered (seeSessionRouter):router_name-- the router's registered name (defaultRaxol.Gateway.SessionRouter):pairing_name-- the pairing server's name (defaultRaxol.Gateway.Pairing):sessions_sup-- the session supervisor's name (defaultRaxol.Gateway.SessionSup):authorize--(Route.t() -> :allow | :deny)the router consults before starting a session or delivering an event (seeSessionRouter). Unset allows everything.:router/:pairing-- extra opts merged into those children
:rest_for_one also means a Pairing crash restarts the sessions and the
router behind it. That is deliberate: sessions authorized under the pre-crash
posture should not outlive it. (The router's :authorize closure captures a
NAME, so it would survive on its own -- the restart is about the sessions.)
Pass the posture as :pairing seed opts rather than calling the running
server, so the restart rebuilds it -- see Raxol.Gateway.Pairing.
The corollary is that Pairing sits on the hot path of every event with the
blast radius of every session behind it, so it must not crash on wire input.
authorize/2 fails closed on a malformed route rather than raising.
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.
@spec start_link(keyword()) :: Supervisor.on_start()