Commit 46dd276d authored by href's avatar href Committed by rinpatch

ConnectionPool.Worker: Open gun conn in continue instead of init

parent 33747e93
......@@ -9,7 +9,12 @@ def start_link([key | _] = opts) do
@impl true
def init([key, uri, opts, client_pid]) do
def init([_key, _uri, _opts, _client_pid] = opts) do
{:ok, nil, {:continue, {:connect, opts}}}
@impl true
def handle_continue({:connect, [key, uri, opts, client_pid]}, _) do
with {:ok, conn_pid} <-, opts), do
time = :erlang.monotonic_time(:millisecond)
......@@ -21,7 +26,7 @@ def init([key, uri, opts, client_pid]) do
send(client_pid, {:conn_pid, conn_pid})
%{key: key, timer: nil, client_monitors: %{client_pid => Process.monitor(client_pid)}},
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment