diff options
author | Loïc Hoguin <[email protected]> | 2013-08-29 17:19:22 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2013-08-29 17:19:22 +0200 |
commit | d8d9014c4beb7d58905bd5e05ff92c6a4a7bbc13 (patch) | |
tree | cf0e522454157abba5ee78f933ed55181fc2cfe3 /manual/gun.md | |
parent | fdae8ff111e5fc65d69c9bbc8cb5fe3affbef428 (diff) | |
download | gun-d8d9014c4beb7d58905bd5e05ff92c6a4a7bbc13.tar.gz gun-d8d9014c4beb7d58905bd5e05ff92c6a4a7bbc13.tar.bz2 gun-d8d9014c4beb7d58905bd5e05ff92c6a4a7bbc13.zip |
Add messages to the documentation
Diffstat (limited to 'manual/gun.md')
-rw-r--r-- | manual/gun.md | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/manual/gun.md b/manual/gun.md index ea624ea..2446523 100644 --- a/manual/gun.md +++ b/manual/gun.md @@ -29,6 +29,88 @@ The default value is given next to the option name. - type (ssl) - Whether to use SSL, plain TCP (for HTTP/Websocket) or SPDY over TCP. +Messages +-------- + +Calling functions from this module may result in the following +messages being sent. + +### {gun_push, ServerPid, StreamRef, AssocToStreamRef, + Method, Host, Path, Headers} + +> Types: +> * ServerPid = pid() +> * StreamRef = AssocToStreamRef = reference() +> * Method = binary() +> * Host = binary() +> * Path = binary() +> * Headers = [{binary(), binary()}] +> +> A resource pushed alongside an HTTP response. + +### {gun_response, ServerPid, StreamRef, IsFin, Status, Headers} + +> Types: +> * ServerPid = pid() +> * StreamRef = reference() +> * IsFin = fin | nofin +> * Status = binary() +> * Headers = [{binary(), binary()}] +> +> A response to an HTTP request. + +### {gun_data, ServerPid, StreamRef, IsFin, Data} + +> Types: +> * ServerPid = pid() +> * StreamRef = reference() +> * IsFin = fin | nofin +> * Data = binary() +> +> Data associated with a response or pushed resource. + +### {gun_error, ServerPid, StreamRef, Reason} + +> Types: +> * ServerPid = pid() +> * StreamRef = reference() +> * Reason = any() +> +> An error specific to a particular stream. + +### {gun_error, ServerPid, Reason} + +> Types: +> * ServerPid = pid() +> * Reason = any() +> +> A general error. + +### {gun_ws_upgrade, ServerPid, ok} + +> Types: +> * ServerPid = pid() +> +> Websocket upgrade success. + +### {gun_ws_upgrade, ServerPid, error, IsFin, Status, Headers} + +> Types: +> * ServerPid = pid() +> * IsFin = fin | nofin +> * Status = binary() +> * Headers = [{binary(), binary()}] +> +> Websocket upgrade failure, with the HTTP response received. + +### {gun_ws, ServerPid, Frame} + +> Types: +> * ServerPid = pid() +> * Frame = ws_frame() +> +> A Websocket frame just received. + Exports ------- |