Skip to content

Commit

Permalink
docs: make sure that channels use finally in all examples (#3796)
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored Oct 15, 2024
1 parent 1a4f1a3 commit 173098b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/usage/channels.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,10 @@ subscriptions need to be managed dynamically.
.. code-block:: python
subscriber = await channels.subscribe(["foo", "bar"])
... # do some stuff here
await channels.unsubscribe(subscriber, ["foo"])
try:
... # do some stuff here
finally:
await channels.unsubscribe(subscriber, ["foo"])
Or, using the context manager
Expand Down

0 comments on commit 173098b

Please sign in to comment.