path: root/doc/src/manual/cowboy_stream_h.asciidoc
diff options
authorLoïc Hoguin <[email protected]>2018-11-18 23:03:30 +0100
committerLoïc Hoguin <[email protected]>2018-11-18 23:03:30 +0100
commit6cc3b0ccca6c06592c2a1881cae39945de805747 (patch)
treec01e57a9ee88a524a2ca6b43b13f831bd96e009e /doc/src/manual/cowboy_stream_h.asciidoc
parent8d6d78575f64055be2d0992d8ccf802d9efa1faa (diff)
Document cowboy_stream_h/cowboy_compress_h
Diffstat (limited to 'doc/src/manual/cowboy_stream_h.asciidoc')
1 files changed, 71 insertions, 0 deletions
diff --git a/doc/src/manual/cowboy_stream_h.asciidoc b/doc/src/manual/cowboy_stream_h.asciidoc
new file mode 100644
index 0000000..caf113b
--- /dev/null
+++ b/doc/src/manual/cowboy_stream_h.asciidoc
@@ -0,0 +1,71 @@
+= cowboy_stream_h(3)
+== Name
+cowboy_stream_h - Default stream handler
+== Description
+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.
+== Options
+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:
+env (#{})::
+Middleware environment.
+middlewares ([cowboy_router, cowboy_handler])::
+Middlewares to run for every request.
+shutdown_timeout (5000)::
+Time in ms Cowboy will wait for child processes to shut down before killing them.
+== Events
+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.
+// @todo It also implements the read_body mechanism.
+// Note that cowboy_stream_h sends the 100-continue automatically.
+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.
+// @todo Add set_options, which updates options dynamically.
+Because this stream handler converts events from the
+request process into commands, other stream handlers
+may not work properly if they are executed
+== Changelog
+* *2.0*: Module introduced.
+== See also