From 4dd6f090e35f9cf067089dfce953647a0999d306 Mon Sep 17 00:00:00 2001 From: Sergei Shuvatov Date: Tue, 8 Mar 2022 12:27:47 +0100 Subject: gun_pool Dialyzer fixes --- src/gun_pool.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gun_pool.erl b/src/gun_pool.erl index 8c40788..5d49a7c 100644 --- a/src/gun_pool.erl +++ b/src/gun_pool.erl @@ -146,7 +146,7 @@ -record(state, { host :: inet:hostname() | inet:ip_address(), port :: inet:port_number(), - opts :: gun:opts(), + opts :: opts(), table :: ets:tid(), conns :: #{pid() => down | {setup, any()} | {up, http | http2 | ws | raw, map()}}, conns_meta = #{} :: meta(), @@ -221,7 +221,7 @@ await_up(Authority, Scope) -> gen_statem:call(ManagerPid, await_up, 5000) end. --spec checkout(pid(), req_opts()) -> undefined | {pid(), map()}. +-spec checkout(pid(), req_opts() | ws_send_opts()) -> undefined | {pid(), map()}. checkout(ManagerPid, ReqOpts=#{checkout_retry := Retry}) when is_list(Retry) -> CallTimeout = maps:get(checkout_call_timeout, ReqOpts, 5000), case gen_server:call(ManagerPid, {checkout, ReqOpts}, CallTimeout) of @@ -381,6 +381,7 @@ authority(Headers) -> {_, Authority} = lists:keyfind(<<"host">>, 1, Headers), Authority. +-spec get_pool(iolist(), req_opts() | ws_send_opts() | stop_opts()) -> pid() | undefined. get_pool(Authority0, ReqOpts) -> Authority = iolist_to_binary(Authority0), %% @todo Perhaps rename this to temporary. -- cgit v1.2.3