opts() :: #{ env => cowboy_middleware:env(), middlewares => [module()], shutdown_timeout => timeout() }
cowboy_stream_h - Default stream handler
The module cowboy_stream_h
is Cowboy's default stream handler and defines much of its behavior. It is responsible for managing the request process, sending it the request body and translating its messages into commands that Cowboy understands.
opts() :: #{ env => cowboy_middleware:env(), middlewares => [module()], shutdown_timeout => timeout() }
Configuration for the default stream handler.
The default value is given next to the option name:
Middleware environment.
Middlewares to run for every request.
Time in ms Cowboy will wait for child processes to shut down before killing them.
The default stream handler spawns the request process and receives its exit signal when it terminates. It will stop the stream once its receives it.
In addition it returns a command for any event message looking like one of the following commands: inform
, response
, headers
, data
, trailers
, push
, switch_protocol
. This is what allows the request process to send a response.
Because this stream handler converts events from the request process into commands, other stream handlers may not work properly if they are executed
Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic:
Recurring payment options are also available via GitHub Sponsors. These funds are used to cover the recurring expenses like food, dedicated servers or domain names.