aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/manual/gun.cancel.asciidoc
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-06-02 22:44:16 +0200
committerLoïc Hoguin <[email protected]>2018-06-02 22:44:16 +0200
commit5b810c924da242632a04a2c44772cb892aa1b7c0 (patch)
treee9ee81bd3b6aea1f9665914b8858edad377c24c7 /doc/src/manual/gun.cancel.asciidoc
parent04b41c3cf70aba88c1dd76e4e86c39458d817219 (diff)
downloadgun-5b810c924da242632a04a2c44772cb892aa1b7c0.tar.gz
gun-5b810c924da242632a04a2c44772cb892aa1b7c0.tar.bz2
gun-5b810c924da242632a04a2c44772cb892aa1b7c0.zip
Revamp the manual, one page per function/message
Diffstat (limited to 'doc/src/manual/gun.cancel.asciidoc')
-rw-r--r--doc/src/manual/gun.cancel.asciidoc68
1 files changed, 68 insertions, 0 deletions
diff --git a/doc/src/manual/gun.cancel.asciidoc b/doc/src/manual/gun.cancel.asciidoc
new file mode 100644
index 0000000..bc2bab9
--- /dev/null
+++ b/doc/src/manual/gun.cancel.asciidoc
@@ -0,0 +1,68 @@
+= gun:cancel(3)
+
+== Name
+
+gun:cancel - Cancel the given stream
+
+== Description
+
+[source,erlang]
+----
+cancel(ConnPid, StreamRef) -> ok
+
+ConnPid :: pid()
+StreamRef :: reference()
+----
+
+Cancel the given stream.
+
+The behavior of this function depends on the protocol
+selected.
+
+HTTP/1.1 does not support this feature. Gun will simply
+silence the stream and stop relaying messages. Gun may
+also decide to close the connection if the response body
+is too large, to avoid wasting time and bandwidth.
+
+HTTP/2 allows cancelling streams at any time.
+
+This function is asynchronous. Messages related to this
+stream may still be sent after the function returns.
+
+== Arguments
+
+ConnPid::
+
+The pid of the Gun connection process.
+
+StreamRef::
+
+Identifier of the stream for the original request.
+
+== Return value
+
+The atom `ok` is returned.
+
+== Changelog
+
+* *1.0*: Function introduced.
+
+== Examples
+
+.Cancel a stream
+[source,erlang]
+----
+gun:cancel(ConnPid, StreamRef).
+----
+
+== See also
+
+link:man:gun(3)[gun(3)],
+link:man:gun:get(3)[gun:get(3)],
+link:man:gun:head(3)[gun:head(3)],
+link:man:gun:options(3)[gun:options(3)],
+link:man:gun:patch(3)[gun:patch(3)],
+link:man:gun:post(3)[gun:post(3)],
+link:man:gun:put(3)[gun:put(3)],
+link:man:gun:delete(3)[gun:delete(3)],
+link:man:gun:request(3)[gun:request(3)]