Skip to content

Commit

Permalink
docs: make sure that channels use finally in all examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Oct 14, 2024
1 parent ad592f6 commit 762cecd
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 762cecd

Please sign in to comment.