PhoenixWebTransport.Quic.Session (phoenix_wtransport v0.1.0)

Copy Markdown View Source

One WebTransport session on erlang_quic, driving a Phoenix.Socket.Transport via PhoenixWebTransport.SessionEngine and PhoenixWebTransport.LaneScheduler.

The process is the HTTP/3 connection's owner, so it receives the extended CONNECT request, the claimed WebTransport streams, datagrams, and the CONNECT stream's capsules. It is also the Phoenix transport pid, so channel pushes arrive here as messages and go out on QUIC streams, one per lane slot, with RFC 9218 urgency caching and congestion-aware watermark pacing.

Summary

Functions

Child specification for starting a session under a DynamicSupervisor.

Options accepted by this listener. :memory_budget is a PhoenixWebTransport.MemoryBudget tuple shared by every session on this listener (see PhoenixWebTransport.Supervisor).

Returns QUIC path metrics (:quic.get_path_stats/1) for the session.

Sends an opt-in RFC 9297 datagram (falling back to control lane 0 if needed).

Returns runtime diagnostics for a live Quic.Session.

Switches the QUIC congestion control algorithm (:bbr | :cubic | :newreno).

Starts an unlinked WebTransport session process.

Starts a supervised WebTransport session process linked to its supervisor.

Functions

child_spec(init_arg)

@spec child_spec({pid(), keyword()}) :: Supervisor.child_spec()

Child specification for starting a session under a DynamicSupervisor.

options(opts)

@spec options(keyword()) :: keyword()

Options accepted by this listener. :memory_budget is a PhoenixWebTransport.MemoryBudget tuple shared by every session on this listener (see PhoenixWebTransport.Supervisor).

path_stats(session)

@spec path_stats(GenServer.server()) :: {:ok, map()} | {:error, term()}

Returns QUIC path metrics (:quic.get_path_stats/1) for the session.

send_datagram(session, payload, opts \\ [])

@spec send_datagram(GenServer.server(), iodata(), keyword()) :: :ok

Sends an opt-in RFC 9297 datagram (falling back to control lane 0 if needed).

session_info(session)

@spec session_info(GenServer.server()) :: {:ok, map()} | {:error, term()}

Returns runtime diagnostics for a live Quic.Session.

set_congestion_control(session, algorithm)

@spec set_congestion_control(GenServer.server(), :bbr | :cubic | :newreno) ::
  :ok | {:error, term()}

Switches the QUIC congestion control algorithm (:bbr | :cubic | :newreno).

set_stream_deadline(session, lane_or_slot, timeout_ms, opts \\ [])

@spec set_stream_deadline(
  GenServer.server(),
  non_neg_integer(),
  pos_integer(),
  keyword()
) ::
  :ok | {:error, term()}

Sets an opt-in send deadline (:quic.set_stream_deadline/4) on a lane or slot.

start(quic_conn, opts)

@spec start(pid(), keyword()) :: GenServer.on_start()

Starts an unlinked WebTransport session process.

start_link(arg)

@spec start_link({pid(), keyword()}) :: GenServer.on_start()

Starts a supervised WebTransport session process linked to its supervisor.