mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 12:40:25 +00:00
Rename 'halt' to 'stop' for better consistency
Now everywhere in Cowboy when we want to stop something we return a 'stop' tuple instead of one of the many choices depending on context that we had before. This particular change affects middlewares, sub protocols and REST handlers which were using 'halt' to stop processing.
This commit is contained in:
parent
8cbd8c1882
commit
999dc5b7c1
13 changed files with 33 additions and 34 deletions
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue