diff options
author | Loïc Hoguin <[email protected]> | 2019-08-02 14:30:08 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-08-05 19:57:13 +0200 |
commit | 611f9a9b78cab4005892e13dffb7a2c8e44580ee (patch) | |
tree | d8d3fc407110ea12333ba122cf711326e82a7070 /doc/src/manual/gun.asciidoc | |
parent | 145b9af4bdbb85e2f83959ee8abaa4d9207a4529 (diff) | |
download | gun-611f9a9b78cab4005892e13dffb7a2c8e44580ee.tar.gz gun-611f9a9b78cab4005892e13dffb7a2c8e44580ee.tar.bz2 gun-611f9a9b78cab4005892e13dffb7a2c8e44580ee.zip |
Add flow control
Flow control is disabled by default. The initial flow value
must be set to enable it (either for the entire connection
or on a per-request basis). Flow applies to all HTTP streams
as well as Websocket. HTTP/2 pushed streams receive the same
value as their originating stream.
Diffstat (limited to 'doc/src/manual/gun.asciidoc')
-rw-r--r-- | doc/src/manual/gun.asciidoc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/src/manual/gun.asciidoc b/doc/src/manual/gun.asciidoc index da5548b..acc1454 100644 --- a/doc/src/manual/gun.asciidoc +++ b/doc/src/manual/gun.asciidoc @@ -46,6 +46,7 @@ Messages: Streams: +* link:man:gun:update_flow(3)[gun:update_flow(3)] - Update a stream's flow control value * link:man:gun:cancel(3)[gun:cancel(3)] - Cancel the given stream * link:man:gun:stream_info(3)[gun:stream_info(3)] - Obtain information about a stream @@ -143,6 +144,7 @@ Handshake timeout for tunneled TLS connections. [source,erlang] ---- http_opts() :: #{ + flow => pos_integer(), keepalive => timeout(), transform_header_name => fun((binary()) -> binary()), version => 'HTTP/1.1' | 'HTTP/1.0' @@ -155,6 +157,11 @@ The default value is given next to the option name: // @todo Document content_handlers and gun_sse_h. +flow - see below:: + +The initial flow control value for all HTTP/1.1 streams. +By default flow control is disabled. + keepalive (infinity):: Time between pings in milliseconds. Since the HTTP protocol has @@ -181,6 +188,7 @@ HTTP version to use. [source,erlang] ---- http2_opts() :: #{ + flow => pos_integer(), keepalive => timeout() } ---- @@ -191,6 +199,11 @@ The default value is given next to the option name: // @todo Document content_handlers and gun_sse_h. +flow - see below:: + +The initial flow control value for all HTTP/2 streams. +By default flow control is disabled. + keepalive (5000):: Time between pings in milliseconds. @@ -328,6 +341,7 @@ Request headers. [source,erlang] ---- req_opts() :: #{ + flow => pos_integer(), reply_to => pid() } ---- @@ -336,6 +350,11 @@ Configuration for a particular request. The default value is given next to the option name: +flow - see below:: + +The initial flow control value for the stream. By default +flow control is disabled. + reply_to (`self()`):: The pid of the process that will receive the response messages. @@ -346,6 +365,7 @@ The pid of the process that will receive the response messages. ---- ws_opts() :: #{ compress => boolean(), + flow => pos_integer(), protocols => [{binary(), module()}] } ---- @@ -360,6 +380,11 @@ Whether to enable permessage-deflate compression. This does not guarantee that compression will be used as it is the server that ultimately decides. Defaults to false. +flow - see below:: + +The initial flow control value for the Websocket connection. +By default flow control is disabled. + protocols ([]):: A non-empty list enables Websocket protocol negotiation. The @@ -378,6 +403,9 @@ undocumented and must be set to `gun_ws_h`. implement different reconnect strategies. * *2.0*: The `transport_opts` option has been split into two options: `tcp_opts` and `tls_opts`. +* *2.0*: Function `gun:update_flow/3` introduced. The `flow` + option was added to request options and HTTP/1.1, + HTTP/2 and Websocket options as well. * *2.0*: Introduce the type `req_headers()` and extend the types accepted for header names for greater interoperability. Header names are automatically |