Packages
A Fair Source multi-agent runtime with deterministic agent scoring and replayable run history.
Current section
Files
Jump to
Current section
Files
lib/syntropy_web/api_socket.ex
defmodule SyntropyWeb.ApiSocket do
@moduledoc """
Phoenix socket for external Syntropy channel consumers.
"""
use Phoenix.Socket
channel "lattice:events", SyntropyWeb.LatticeChannel
@impl true
def connect(params, socket, _connect_info) do
case SyntropyWeb.ApiAuth.validate_socket(params) do
{:ok, _scope} -> {:ok, socket}
{:error, _reason} -> :error
end
end
@impl true
def id(_socket), do: nil
end