Skip to content

Manager API

connection

Manager for handling numerous concurrent connection lifecycles.

ConnectionManager

Manage multiple WebTransport connections using event-driven cleanup.

add_connection async

add_connection(*, connection: WebTransportConnection) -> ConnectionHandle

Add a new connection and subscribe to its closure event.

get_stats async

get_stats() -> dict[str, Any]

Get detailed statistics about the managed connections.

remove_connection async

remove_connection(*, connection_handle: ConnectionHandle) -> WebTransportConnection | None

Manually remove a connection from management.

shutdown async

shutdown() -> None

Shut down the manager and ensure all closing tasks complete.

session

Manager for concurrent session lifecycles.

SessionManager

Manage multiple WebTransport sessions using event-driven cleanup.

add_session async

add_session(*, session: WebTransportSession) -> SessionId

Add a new session and subscribe to its closure event.

get_sessions_by_state async

get_sessions_by_state(*, state: SessionState) -> list[WebTransportSession]

Retrieve sessions that are in a specific state.

get_stats async

get_stats() -> dict[str, Any]

Get detailed statistics about the managed sessions.

remove_session async

remove_session(*, session_id: SessionId) -> WebTransportSession | None

Manually remove a session from management.