diff options
Diffstat (limited to 'doc/src/manual')
-rw-r--r-- | doc/src/manual/cowboy_loop.ezdoc | 8 | ||||
-rw-r--r-- | doc/src/manual/cowboy_middleware.ezdoc | 4 | ||||
-rw-r--r-- | doc/src/manual/cowboy_rest.ezdoc | 4 | ||||
-rw-r--r-- | doc/src/manual/cowboy_sub_protocol.ezdoc | 3 | ||||
-rw-r--r-- | doc/src/manual/cowboy_websocket.ezdoc | 28 |
5 files changed, 17 insertions, 30 deletions
diff --git a/doc/src/manual/cowboy_loop.ezdoc b/doc/src/manual/cowboy_loop.ezdoc index 196cec6..79b96f9 100644 --- a/doc/src/manual/cowboy_loop.ezdoc +++ b/doc/src/manual/cowboy_loop.ezdoc @@ -29,10 +29,10 @@ The connection was closed normally before switching to the loop sub protocol. This typically happens if an `ok` tuple is returned from the `init/2` callback. -: shutdown +: stop The handler requested to close the connection by returning -a `shutdown` tuple. +a `stop` tuple. : timeout @@ -72,7 +72,7 @@ A socket error ocurred. : info(Info, Req, State) -> {ok, Req, State} | {ok, Req, State, hibernate} - | {shutdown, Req, State} + | {stop, Req, State} Types: @@ -85,7 +85,7 @@ Handle the Erlang message received. This function will be called every time an Erlang message has been received. The message can be any Erlang term. -The `shutdown` return value can be used to stop the receive loop, +The `stop` return value can be used to stop the receive loop, typically because a response has been sent. The `hibernate` option will hibernate the process until diff --git a/doc/src/manual/cowboy_middleware.ezdoc b/doc/src/manual/cowboy_middleware.ezdoc index 2275d35..dacaf6c 100644 --- a/doc/src/manual/cowboy_middleware.ezdoc +++ b/doc/src/manual/cowboy_middleware.ezdoc @@ -21,7 +21,7 @@ optionally with its contents modified. : execute(Req, Env) -> {ok, Req, Env} | {suspend, Module, Function, Args} - | {halt, Req} + | {stop, Req} Types: @@ -41,7 +41,7 @@ The `suspend` return value will hibernate the process until an Erlang message is received. Note that when resuming, any previous stacktrace information will be gone. -The `halt` return value stops Cowboy from doing any further +The `stop` return value stops Cowboy from doing any further processing of the request, even if there are middlewares that haven't been executed yet. The connection may be left open to receive more requests from the client. diff --git a/doc/src/manual/cowboy_rest.ezdoc b/doc/src/manual/cowboy_rest.ezdoc index f9e938a..eef622a 100644 --- a/doc/src/manual/cowboy_rest.ezdoc +++ b/doc/src/manual/cowboy_rest.ezdoc @@ -58,7 +58,7 @@ stacktrace of the process when the crash occurred. :: Callbacks -: Callback(Req, State) -> {Value, Req, State} | {halt, Req, State} +: Callback(Req, State) -> {Value, Req, State} | {stop, Req, State} Types: @@ -72,7 +72,7 @@ on the `Value` type, the default value if the callback is not defined, and more general information on when the callback is called and what its intended use is. -The `halt` tuple can be returned to stop REST processing. +The `stop` tuple can be returned to stop REST processing. It is up to the resource code to send a reply before that, otherwise a `204 No Content` will be sent. diff --git a/doc/src/manual/cowboy_sub_protocol.ezdoc b/doc/src/manual/cowboy_sub_protocol.ezdoc index 4ad25f3..ee57beb 100644 --- a/doc/src/manual/cowboy_sub_protocol.ezdoc +++ b/doc/src/manual/cowboy_sub_protocol.ezdoc @@ -8,8 +8,7 @@ by modules that implement a protocol on top of HTTP. : upgrade(Req, Env, Handler, Opts) -> {ok, Req, Env} | {suspend, Module, Function, Args} - | {halt, Req} - | {error, StatusCode, Req} + | {stop, Req} Types: diff --git a/doc/src/manual/cowboy_websocket.ezdoc b/doc/src/manual/cowboy_websocket.ezdoc index 7311662..2519dba 100644 --- a/doc/src/manual/cowboy_websocket.ezdoc +++ b/doc/src/manual/cowboy_websocket.ezdoc @@ -22,18 +22,6 @@ Cowboy will terminate the process right after closing the Websocket connection. This means that there is no real need to perform any cleanup in the optional `terminate/3` callback. -:: Types - -: close_code() = 1000..4999 - -Reason for closing the connection. - -: frame() = close | ping | pong - | {text | binary | close | ping | pong, iodata()} - | {close, close_code(), iodata()} - -Frames that can be sent to the client. - :: Meta values : websocket_compress @@ -69,10 +57,10 @@ further details. The remote endpoint closed the connection with the given `Code` and `Payload` as the reason. -: shutdown +: stop The handler requested to close the connection, either by returning -a `shutdown` tuple or by sending a `close` frame. +a `stop` tuple or by sending a `close` frame. : timeout @@ -111,21 +99,21 @@ A socket error ocurred. | {ok, Req, State, hibernate} | {reply, OutFrame | [OutFrame], Req, State} | {reply, OutFrame | [OutFrame], Req, State, hibernate} - | {shutdown, Req, State} + | {stop, Req, State} Types: * InFrame = {text | binary | ping | pong, binary()} * Req = cowboy_req:req() * State = any() -* OutFrame = frame() +* OutFrame = cow_ws:frame() Handle the data received from the Websocket connection. This function will be called every time data is received from the Websocket connection. -The `shutdown` return value can be used to close the +The `stop` return value can be used to close the connection. A close reply will also result in the connection being closed. @@ -138,21 +126,21 @@ Erlang message. | {ok, Req, State, hibernate} | {reply, OutFrame | [OutFrame], Req, State} | {reply, OutFrame | [OutFrame], Req, State, hibernate} - | {shutdown, Req, State} + | {stop, Req, State} Types: * Info = any() * Req = cowboy_req:req() * State = any() -* OutFrame = frame() +* OutFrame = cow_ws:frame() Handle the Erlang message received. This function will be called every time an Erlang message has been received. The message can be any Erlang term. -The `shutdown` return value can be used to close the +The `stop` return value can be used to close the connection. A close reply will also result in the connection being closed. |