mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 20:30:23 +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
|
@ -23,7 +23,7 @@ Middlewares can return one of four 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`
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue