0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Document the set_options stream handler command

This commit is contained in:
Loïc Hoguin 2019-10-07 12:04:39 +02:00
parent e25fb19bab
commit fad0ac8fb6
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
4 changed files with 32 additions and 1 deletions

View file

@ -37,11 +37,17 @@ compress_buffering (false)::
Whether the output will be buffered. By default no Whether the output will be buffered. By default no
buffering is done to provide maximum compatibility buffering is done to provide maximum compatibility
at the cost of a lower compression rate. at the cost of a lower compression rate.
+
This option can be updated at any time using the
`set_options` stream handler command.
compress_threshold (300):: compress_threshold (300)::
How large the response body must be to be compressed How large the response body must be to be compressed
when the response isn't streamed. when the response isn't streamed.
+
This option can be updated at any time using the
`set_options` stream handler command.
== Events == Events

View file

@ -56,6 +56,9 @@ Whether chunked transfer-encoding is enabled for HTTP/1.1 connections.
Note that a response streamed to the client without the chunked Note that a response streamed to the client without the chunked
transfer-encoding and without a content-length header will result transfer-encoding and without a content-length header will result
in the connection being closed at the end of the response body. in the connection being closed at the end of the response body.
+
This option can be updated at any time using the
`set_options` stream handler command.
connection_type (supervisor):: connection_type (supervisor)::
@ -68,6 +71,9 @@ Whether keep-alive is enabled for HTTP/1.0 connections.
idle_timeout (60000):: idle_timeout (60000)::
Time in ms with no data received before Cowboy closes the connection. Time in ms with no data received before Cowboy closes the connection.
+
This option can be updated at any time using the
`set_options` stream handler command.
inactivity_timeout (300000):: inactivity_timeout (300000)::

View file

@ -257,6 +257,22 @@ Log a message.
This command can be used to log a message using the This command can be used to log a message using the
configured `logger` module. configured `logger` module.
=== set_options
Set protocol options.
[source,erlang]
----
{set_options, map()}
----
This can also be used to override stream handler
options. For example this is supported by
link:man:cowboy_compress_h(3)[cowboy_compress_h(3)].
Not all options can be overriden. Please consult the
relevant option's documentation for details.
== Predefined events == Predefined events
Cowboy will forward all messages sent to the stream to Cowboy will forward all messages sent to the stream to
@ -377,7 +393,7 @@ tuple.
== Changelog == Changelog
* *2.7*: The `log` command was introduced. * *2.7*: The `log` and `set_options` commands were introduced.
* *2.6*: The `data` command can now contain a sendfile tuple. * *2.6*: The `data` command can now contain a sendfile tuple.
* *2.6*: The `{stop, {exit, any()}, HumanReadable}` terminate reason was added. * *2.6*: The `{stop, {exit, any()}, HumanReadable}` terminate reason was added.
* *2.2*: The `trailers` command was introduced. * *2.2*: The `trailers` command was introduced.

View file

@ -232,6 +232,9 @@ idle_timeout (60000)::
Time in milliseconds that Cowboy will keep the Time in milliseconds that Cowboy will keep the
connection open without receiving anything from connection open without receiving anything from
the client. the client.
+
This option can be updated at any time using the
`set_options` command.
max_frame_size (infinity):: max_frame_size (infinity)::