0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 12:40:25 +00:00

Add optional callbacks

Mostly useful for REST, which has a ton. This is an initial
commit, it still needs to be tested, but it's time to sleep.
This commit is contained in:
Loïc Hoguin 2015-07-27 23:58:58 +02:00
parent dd1eaee0cd
commit e25634cd9d
5 changed files with 192 additions and 5 deletions

View file

@ -45,7 +45,9 @@
| {reply, cow_ws:frame() | [cow_ws:frame()], Req, State, hibernate}
| {stop, Req, State}
when Req::cowboy_req:req(), State::any().
%% @todo optional -callback terminate(terminate_reason(), cowboy_req:req(), state()) -> ok.
-callback terminate(any(), cowboy_req:req(), any()) -> ok.
-optional_callbacks([terminate/3]).
-record(state, {
env :: cowboy_middleware:env(),