Skip to content

Commit 569985c

Browse files
committed
fixup! Explain the Receiver.close() method in the user guide
Signed-off-by: Sahas Subramanian <[email protected]>
1 parent cd70b3a commit 569985c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/frequenz/channels/_receiver.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,11 @@
125125
126126
# Closing receivers
127127
128-
To deal with situations where data from a particular stream is no-longer required,
129-
receivers offer a [`close()`][frequenz.channels.Receiver.close] method that can be used
130-
to stop it from receiving new messages.
128+
When a particular stream of data is no-longer required, it is a good practice to close
129+
the receiver to free up resources. This is especially important in applications that are
130+
repeatedly creating new receivers. The
131+
[`Receiver.close()`][frequenz.channels.Receiver.close] method can be used for this
132+
purpose.
131133
132134
After `close()` is called, we can still receive messages that are in the receiver's
133135
buffer, but as soon as the receiver's buffer has been drained, trying to receive further

0 commit comments

Comments
 (0)