We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Receiver.close()
1 parent b27175a commit cd70b3aCopy full SHA for cd70b3a
src/frequenz/channels/_receiver.py
@@ -123,6 +123,17 @@
123
# If we get here, the receiver was stopped
124
```
125
126
+# Closing receivers
127
+
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.
131
132
+After `close()` is called, we can still receive messages that are in the receiver's
133
+buffer, but as soon as the receiver's buffer has been drained, trying to receive further
134
+messages from a *closed* receiver will raise a
135
+[`ReceiverStoppedError`][frequenz.channels.ReceiverStoppedError].
136
137
# Advanced Usage
138
139
!!! Warning inline end
0 commit comments