PhoenixWebTransport.Backend behaviour (phoenix_wtransport v0.1.0)

Copy Markdown View Source

Contract for WebTransport server listener backends.

Defaults to PhoenixWebTransport.Quic.Listener (erlang_quic).

Summary

Callbacks

Returns whether this backend's runtime dependencies are available.

Describes backend transport capabilities.

Starts the backend listener process.

Functions

Resolves the listener module for :quic or :auto.

Types

backend_name()

@type backend_name() :: :quic | :auto

Callbacks

available?()

@callback available?() :: boolean()

Returns whether this backend's runtime dependencies are available.

capabilities()

@callback capabilities() :: %{
  native_build: boolean(),
  datagrams: boolean(),
  stream_priority: atom()
}

Describes backend transport capabilities.

start_link(keyword)

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

Starts the backend listener process.

Functions

resolve(backend)

@spec resolve(backend_name()) :: {:ok, module()} | {:error, term()}

Resolves the listener module for :quic or :auto.