aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/guide
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/guide')
-rw-r--r--doc/src/guide/getting_started.ezdoc2
-rw-r--r--doc/src/guide/loop_handlers.ezdoc6
-rw-r--r--doc/src/guide/middlewares.ezdoc4
-rw-r--r--doc/src/guide/rest_handlers.ezdoc2
-rw-r--r--doc/src/guide/ws_handlers.ezdoc9
5 files changed, 12 insertions, 11 deletions
diff --git a/doc/src/guide/getting_started.ezdoc b/doc/src/guide/getting_started.ezdoc
index a959b45..deb7bf2 100644
--- a/doc/src/guide/getting_started.ezdoc
+++ b/doc/src/guide/getting_started.ezdoc
@@ -121,7 +121,7 @@ start(_Type, _Args) ->
Dispatch = cowboy_router:compile([
{'_', [{"/", hello_handler, []}]}
]),
- cowboy:start_http(my_http_listener, 100, [{port, 8080}],
+ {ok, _} = cowboy:start_http(my_http_listener, 100, [{port, 8080}],
[{env, [{dispatch, Dispatch}]}]
),
hello_erlang_sup:start_link().
diff --git a/doc/src/guide/loop_handlers.ezdoc b/doc/src/guide/loop_handlers.ezdoc
index 4be178e..47893a9 100644
--- a/doc/src/guide/loop_handlers.ezdoc
+++ b/doc/src/guide/loop_handlers.ezdoc
@@ -61,7 +61,7 @@ message otherwise.
``` erlang
info({reply, Body}, Req, State) ->
Req2 = cowboy_req:reply(200, [], Body, Req),
- {shutdown, Req2, State};
+ {stop, Req2, State};
info(_Msg, Req, State) ->
{ok, Req, State, hibernate}.
```
@@ -76,7 +76,7 @@ return a tuple indicating if more messages are to be expected.
The callback may also choose to do nothing at all and just
skip the message received.
-If a reply is sent, then the `shutdown` tuple should be returned.
+If a reply is sent, then the `stop` tuple should be returned.
This will instruct Cowboy to end the request.
Otherwise an `ok` tuple should be returned.
@@ -99,7 +99,7 @@ init(Req, _Opts) ->
{cowboy_loop, Req2, #state{}}.
info(eof, Req, State) ->
- {shutdown, Req, State};
+ {stop, Req, State};
info({chunk, Chunk}, Req, State) ->
cowboy_req:chunk(Chunk, Req),
{ok, Req, State};
diff --git a/doc/src/guide/middlewares.ezdoc b/doc/src/guide/middlewares.ezdoc
index 0c142f9..8b047d7 100644
--- a/doc/src/guide/middlewares.ezdoc
+++ b/doc/src/guide/middlewares.ezdoc
@@ -19,11 +19,11 @@ It is defined in the `cowboy_middleware` behavior.
This callback has two arguments. The first is the `Req` object.
The second is the environment.
-Middlewares can return one of four different values:
+Middlewares can return one of three different values:
* `{ok, Req, Env}` to continue the request processing
* `{suspend, Module, Function, Args}` to hibernate
-* `{halt, Req}` to stop processing and move on to the next request
+* `{stop, Req}` to stop processing and move on to the next request
Of note is that when hibernating, processing will resume on the given
MFA, discarding all previous stacktrace. Make sure you keep the `Req`
diff --git a/doc/src/guide/rest_handlers.ezdoc b/doc/src/guide/rest_handlers.ezdoc
index 71a471f..e6bb092 100644
--- a/doc/src/guide/rest_handlers.ezdoc
+++ b/doc/src/guide/rest_handlers.ezdoc
@@ -41,7 +41,7 @@ you need.
All callbacks take two arguments, the Req object and the State,
and return a three-element tuple of the form `{Value, Req, State}`.
-All callbacks can also return `{halt, Req, State}` to stop execution
+All callbacks can also return `{stop, Req, State}` to stop execution
of the request.
The following table summarizes the callbacks and their default values.
diff --git a/doc/src/guide/ws_handlers.ezdoc b/doc/src/guide/ws_handlers.ezdoc
index 9f0fcbb..a0cfc29 100644
--- a/doc/src/guide/ws_handlers.ezdoc
+++ b/doc/src/guide/ws_handlers.ezdoc
@@ -42,7 +42,7 @@ init(Req, _Opts) ->
<<"mychat2">>, Req),
{ok, Req2, #state{}};
false ->
- {shutdown, Req, undefined}
+ {stop, Req, undefined}
end
end.
```
@@ -75,7 +75,7 @@ ping or pong frame arrives from the client. Note that in the
case of ping and pong frames, no action is expected as Cowboy
automatically replies to ping frames.
-The handler can decide to send frames to the socket, shutdown
+The handler can decide to send frames to the socket, stop
or just continue without sending anything.
The following snippet echoes back any text frame received and
@@ -93,7 +93,7 @@ websocket_handle(_Frame, Req, State) ->
Cowboy will call `websocket_info/3` whenever an Erlang message
arrives.
-The handler can decide to send frames to the socket, shutdown
+The handler can decide to send frames to the socket, stop
or just continue without sending anything.
The following snippet forwards any `log` message to the socket
@@ -109,7 +109,8 @@ websocket_info(_Info, Req, State) ->
:: Sending frames to the socket
Cowboy allows sending either a single frame or a list of
-frames to the socket. Any frame can be sent: text, binary, ping,
+frames to the socket, in which case the frames are sent
+sequentially. Any frame can be sent: text, binary, ping,
pong or close frames.
The following example sends three frames using a single `reply`