aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/manual/gun.flush.asciidoc
blob: d4ee0c67669435a8ebdb04916ff88294eb4952a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
= gun:flush(3)

== Name

gun:flush - Flush all messages related to a connection or a stream

== Description

[source,erlang]
----
flush(ConnPid) -> ok
flush(StreamRef) -> ok

ConnPid    :: pid()
StreamRef  :: gun:stream_ref()
----

Flush all messages related to a connection or a stream.

== Arguments

Either of these arguments may be provided:

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

.Flush all messages from a connection
[source,erlang]
----
gun:flush(ConnPid).
----

.Flush messages from a single stream
[source,erlang]
----
gun:flush(StreamRef).
----

== See also

link:man:gun(3)[gun(3)],
link:man:gun:await(3)[gun:await(3)],
link:man:gun:await_body(3)[gun:await_body(3)],
link:man:gun:await_up(3)[gun:await_up(3)]