diff options
Diffstat (limited to 'src/cowboy_loop_handler.erl')
-rw-r--r-- | src/cowboy_loop_handler.erl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/cowboy_loop_handler.erl b/src/cowboy_loop_handler.erl index 067d672..71323d2 100644 --- a/src/cowboy_loop_handler.erl +++ b/src/cowboy_loop_handler.erl @@ -23,8 +23,8 @@ %% receive. It receives the message and the state previously defined. %% It can decide to stop the receive loop or continue receiving. %% -%% <em>terminate/2</em> allows you to clean up. It receives the state -%% previously defined. +%% <em>terminate/3</em> allows you to clean up. It receives the +%% termination reason and the state previously defined. %% %% There is no required operation to perform in any of these callbacks %% other than returning the proper values. Make sure you always return @@ -39,6 +39,9 @@ -type opts() :: any(). -type state() :: any(). +-type terminate_reason() :: {normal, shutdown} + | {normal, timeout} + | {error, atom()}. -callback init({atom(), http}, Req, opts()) -> {ok, Req, state()} @@ -54,4 +57,4 @@ | {loop, Req, State} | {loop, Req, State, hibernate} when Req::cowboy_req:req(), State::state(). --callback terminate(cowboy_req:req(), state()) -> ok. +-callback terminate(terminate_reason(), cowboy_req:req(), state()) -> ok. |