PhoenixWebTransport.Supervisor (phoenix_wtransport v0.1.0)

Copy Markdown View Source

Production supervision tree for a WebTransport listener and its sessions.

Starts four children under :one_for_one in exact startup order (so OTP terminates them in reverse order during graceful shutdown):

  1. Registry (:duplicate) tracking live WebTransport session pids
  2. DynamicSupervisor supervising individual session processes (:temporary)
  3. Backend listener (PhoenixWebTransport.Quic.Listener)
  4. PhoenixWebTransport.Drainer signalling live sessions on shutdown before the UDP listener closes

Example

# In application.ex after MyAppWeb.Endpoint
{PhoenixWebTransport.Supervisor,
 endpoint: MyAppWeb.Endpoint,
 port: 4433}

Summary

Functions

Returns a specification to start this module under a supervisor.

Returns the UDP port bound by the supervised listener.

Returns all currently registered live session pids under supervisor.

Starts the WebTransport supervision tree unless enabled: false.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

port(supervisor \\ __MODULE__)

Returns the UDP port bound by the supervised listener.

sessions(supervisor \\ __MODULE__)

@spec sessions(Supervisor.supervisor()) :: [pid()]

Returns all currently registered live session pids under supervisor.

start_link(opts)

@spec start_link(keyword()) :: Supervisor.on_start()

Starts the WebTransport supervision tree unless enabled: false.