Skip to content

Commit ae9dbf5

Browse files
committed
DOCS: mention that Client is a context manager
1 parent 092623a commit ae9dbf5

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎jack.py‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,11 @@ def __init__(self, name, use_exact_name=False, no_start_server=False,
328328
servername=None, session_id=None):
329329
"""Create a new JACK client.
330330
331+
A client object is a *context manager*, i.e. it can be used in a
332+
*with statement* to automatically call :meth:`activate` in the
333+
beginning of the statement and :meth:`deactivate` and
334+
:meth:`close` on exit.
335+
331336
Parameters
332337
----------
333338
name : str
@@ -836,7 +841,10 @@ def set_shutdown_callback(self, callback):
836841
After server shutdown, the client is *not*
837842
deallocated by JACK, the user (that's you!) is
838843
responsible to properly use :meth:`close` to release
839-
client ressources.
844+
client ressources. Alternatively, the :class:`Client`
845+
object can be used as a *context manager* in a *with
846+
statement*, which takes care of activating, deactivating
847+
and closing the client automatically.
840848
841849
"""
842850
@self._callback("JackInfoShutdownCallback")

0 commit comments

Comments
 (0)