File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 123123# If we get here, the receiver was stopped
124124```
125125
126+ # Closing receivers
127+
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.
133+
134+ After `close()` is called, we can still receive messages that are in the receiver's
135+ buffer, but as soon as the receiver's buffer has been drained, trying to receive further
136+ messages from a *closed* receiver will raise a
137+ [`ReceiverStoppedError`][frequenz.channels.ReceiverStoppedError].
138+
126139# Advanced Usage
127140
128141!!! Warning inline end
You can’t perform that action at this time.
0 commit comments