aboutsummaryrefslogtreecommitdiffstats
path: root/src/ranch_server_proxy.erl
diff options
context:
space:
mode:
authorjuhlig <[email protected]>2019-06-24 13:18:31 +0200
committerLoïc Hoguin <[email protected]>2019-07-01 13:20:43 +0200
commit37e64f50df640803625771bc3655b6db6c351493 (patch)
tree63a5d6160295bfca0197193cdeeb2fddd11b9be2 /src/ranch_server_proxy.erl
parente8d6401741021f76988091e6dc633afb65ffbe7b (diff)
downloadranch-37e64f50df640803625771bc3655b6db6c351493.tar.gz
ranch-37e64f50df640803625771bc3655b6db6c351493.tar.bz2
ranch-37e64f50df640803625771bc3655b6db6c351493.zip
Add missing specs
Diffstat (limited to 'src/ranch_server_proxy.erl')
-rw-r--r--src/ranch_server_proxy.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ranch_server_proxy.erl b/src/ranch_server_proxy.erl
index 949ac33..b03b5bb 100644
--- a/src/ranch_server_proxy.erl
+++ b/src/ranch_server_proxy.erl
@@ -23,9 +23,11 @@
-export([handle_info/2]).
-export([code_change/3]).
+-spec start_link() -> {ok, pid()} | {error, term()}.
start_link() ->
gen_server:start_link(?MODULE, [], []).
+-spec init([]) -> {ok, pid()} | {stop, term()}.
init([]) ->
case wait_ranch_server(50) of
{ok, Monitor} ->
@@ -34,17 +36,21 @@ init([]) ->
{stop, Reason}
end.
+-spec handle_call(_, _, reference()) -> {noreply, reference(), hibernate}.
handle_call(_, _, Monitor) ->
{noreply, Monitor, hibernate}.
+-spec handle_cast(_, reference()) -> {noreply, reference(), hibernate}.
handle_cast(_, Monitor) ->
{noreply, Monitor, hibernate}.
+-spec handle_info(term(), reference()) -> {noreply, reference(), hibernate} | {stop, term(), reference()}.
handle_info({'DOWN', Monitor, process, _, Reason}, Monitor) ->
{stop, Reason, Monitor};
handle_info(_, Monitor) ->
{noreply, Monitor, hibernate}.
+-spec code_change(term() | {down, term()}, reference(), term()) -> {ok, reference()}.
code_change(_, Monitor, _) ->
{ok, Monitor}.