WebsockexAdapter.ConnectionRegistry (WebsockexAdapter v0.1.1)

View Source

ETS-based connection tracking without GenServer.

Summary

Functions

Cleanup dead connection by PID.

Deregister a connection by ID.

Get connection info by ID.

Initialize the connection registry ETS table.

Register a connection with monitoring.

Cleanup all connections and destroy table.

Functions

cleanup_dead(gun_pid)

@spec cleanup_dead(pid()) :: :ok

Cleanup dead connection by PID.

deregister(connection_id)

@spec deregister(String.t()) :: :ok

Deregister a connection by ID.

get(connection_id)

@spec get(String.t()) :: {:ok, pid()} | {:error, :not_found}

Get connection info by ID.

init()

@spec init() :: :ok

Initialize the connection registry ETS table.

register(connection_id, gun_pid)

@spec register(String.t(), pid()) :: :ok

Register a connection with monitoring.

shutdown()

@spec shutdown() :: :ok

Cleanup all connections and destroy table.