defmodule Kvasir.AgentServer.Control.Handler do import Kvasir.AgentServer.Util, only: [recommended_listener_config: 1] @spec child_spec(Keyword.t()) :: :supervisor.child_spec() def child_spec(opts \\ []) do id = opts[:id] || make_ref() config = recommended_listener_config(opts) :ranch.child_spec(id, :ranch_tcp, config, Kvasir.AgentServer.Control.Protocol, opts[:server]) end end