Просмотр исходного кода

Document the set_options stream handler command

Loïc Hoguin 5 лет назад
Родитель
Сommit
fad0ac8fb6

+ 6 - 0
doc/src/manual/cowboy_compress_h.asciidoc

@@ -37,11 +37,17 @@ compress_buffering (false)::
 Whether the output will be buffered. By default no
 buffering is done to provide maximum compatibility
 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)::
 
 How large the response body must be to be compressed
 when the response isn't streamed.
++
+This option can be updated at any time using the
+`set_options` stream handler command.
 
 == Events
 

+ 6 - 0
doc/src/manual/cowboy_http.asciidoc

@@ -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
 transfer-encoding and without a content-length header will result
 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)::
 
@@ -68,6 +71,9 @@ Whether keep-alive is enabled for HTTP/1.0 connections.
 idle_timeout (60000)::
 
 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)::
 

+ 17 - 1
doc/src/manual/cowboy_stream.asciidoc

@@ -257,6 +257,22 @@ Log a message.
 This command can be used to log a message using the
 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
 
 Cowboy will forward all messages sent to the stream to
@@ -377,7 +393,7 @@ tuple.
 
 == 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 `{stop, {exit, any()}, HumanReadable}` terminate reason was added.
 * *2.2*: The `trailers` command was introduced.

+ 3 - 0
doc/src/manual/cowboy_websocket.asciidoc

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