diff options
author | Loïc Hoguin <[email protected]> | 2019-06-02 17:26:37 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-06-02 17:28:34 +0200 |
commit | b4c7749176e0a55b5763f3e04bf9312adff7ea82 (patch) | |
tree | cbb923a692aa3c578501a0a27e550ec9a4062a71 /src/gun_event.erl | |
parent | a309f196d15d3045d2e70b2d7e23858f47adb7df (diff) | |
download | gun-b4c7749176e0a55b5763f3e04bf9312adff7ea82.tar.gz gun-b4c7749176e0a55b5763f3e04bf9312adff7ea82.tar.bz2 gun-b4c7749176e0a55b5763f3e04bf9312adff7ea82.zip |
Add request_start, request_headers and request_end events
Diffstat (limited to 'src/gun_event.erl')
-rw-r--r-- | src/gun_event.erl | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/src/gun_event.erl b/src/gun_event.erl index 3d83bea..56f1a36 100644 --- a/src/gun_event.erl +++ b/src/gun_event.erl @@ -43,6 +43,31 @@ -callback connect_start(connect_event(), State) -> State. -callback connect_end(connect_event(), State) -> State. +%% request_start/request_headers. + +-type request_start_event() :: #{ + stream_ref := reference(), + reply_to := pid(), + function := headers | request, + method := iodata(), + scheme => binary(), + authority := iodata(), + path := iodata(), + headers := [{binary(), iodata()}] +}. + +-callback request_start(request_start_event(), State) -> State. +-callback request_headers(request_start_event(), State) -> State. + +%% request_end. + +-type request_end_event() :: #{ + stream_ref := reference(), + reply_to := pid() +}. + +-callback request_end(request_end_event(), State) -> State. + %% disconnect. -type disconnect_event() :: #{ @@ -67,17 +92,14 @@ %% @todo origin_changed %% @todo transport_changed %% @todo protocol_changed -%% @todo stream_start -%% @todo stream_end -%% @todo request_start -%% @todo request_headers -%% @todo request_end %% @todo response_start (call it once per inform + one for the response) %% @todo response_inform %% @todo response_headers %% @todo response_end %% @todo push_promise_start %% @todo push_promise_end +%% @todo cancel_start +%% @todo cancel_end %% @todo ws_upgrade_start %% @todo ws_upgrade_end %% @todo ws_frame_read_start |