Skip to content

Commit 4ef7463

Browse files
committed
elli_websocket_handler: cosmetic tweaks
1 parent 7bd640b commit 4ef7463

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

src/elli_websocket_handler.erl

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,35 @@
2323

2424
-include_lib("elli_websocket.hrl").
2525

26+
2627
-callback websocket_init(Req :: elli:req(), Args :: any()) ->
27-
{ok, Headers :: elli:headers(), State :: any()} |
28-
{ok, Headers :: elli:headers(), hibernate, State :: any()} |
29-
{ok, Headers :: elli:headers(), Timeout :: non_neg_integer(), State :: any()} |
30-
{ok, Headers :: elli:headers(), hibernate, Timeout :: non_neg_integer(), State :: any()} |
31-
{shutdown, Headers :: elli:headers()}.
28+
{ok, Headers, State} |
29+
{ok, Headers, hibernate, State} |
30+
{ok, Headers, Timeout, State} |
31+
{ok, Headers, hibernate, Timeout, State} |
32+
{shutdown, Headers} when
33+
Headers :: elli:headers(),
34+
State :: any(),
35+
Timeout :: non_neg_integer().
36+
37+
38+
-callback websocket_handle(Req, Message, State) ->
39+
{reply, ReplyMessage, ReplyState} | {ok, State} when
40+
Req :: elli:req(),
41+
Message :: elli_websocket:message(),
42+
State :: any(),
43+
ReplyState :: any(),
44+
ReplyMessage :: elli_websocket:message().
3245

3346

34-
-callback websocket_handle(Req :: elli:req(), Message :: elli_websocket:message(), State :: any()) ->
35-
{reply, ReplyMessage :: elli_websocket:message(), State}.
47+
-callback websocket_info(Req, Message, State) -> {ok, ReplyState} when
48+
Req :: elli:req(),
49+
Message :: any(),
50+
State :: any(),
51+
ReplyState :: any().
3652

37-
-callback websocket_info(Req :: elli:req(), Message :: any(), State :: any()) ->
38-
{ok, ReplyState :: any()}.
3953

40-
-callback websocket_handle_event(Event :: elli_websocket:event(), Args :: list(), State :: any()) ->
41-
ok.
54+
-callback websocket_handle_event(Event, Args, State) -> ok when
55+
Event :: elli_websocket:event(),
56+
Args :: list(),
57+
State :: any().

0 commit comments

Comments
 (0)