PhoenixWebTransport.Drainer (phoenix_wtransport v0.1.0)

Copy Markdown View Source

Graceful shutdown drainer started after the listener inside PhoenixWebTransport.Supervisor.

Because OTP supervises children in reverse startup order on termination, this process's terminate/2 runs before the QUIC listener stops: it signals every registered WebTransport session in batches (:phoenix_wt_drain), emits [:phoenix_wtransport, :drain] telemetry, and waits for active sessions to send DRAIN_WEBTRANSPORT_SESSION + 1012 close capsules within :drain_timeout.

Summary

Functions

Child specification with shutdown timeout covering drain execution.

Lists live registered session pids tracked by drainer.

Starts the drainer process.

Functions

child_spec(init_arg)

@spec child_spec(keyword()) :: Supervisor.child_spec()

Child specification with shutdown timeout covering drain execution.

sessions(drainer)

@spec sessions(GenServer.server()) :: [pid()]

Lists live registered session pids tracked by drainer.

start_link(opts)

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

Starts the drainer process.