From 7ba2b8b728552412ae0acbb6b4f4bf57226b8f4a Mon Sep 17 00:00:00 2001 From: moto <855818+mthrok@users.noreply.github.com> Date: Fri, 10 Jul 2026 18:27:07 -0400 Subject: [PATCH] Update docs - Remove `auto_stop` - Fix directive --- src/spdl/pipeline/_pipeline.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/spdl/pipeline/_pipeline.py b/src/spdl/pipeline/_pipeline.py index 1185da704..f4265a100 100644 --- a/src/spdl/pipeline/_pipeline.py +++ b/src/spdl/pipeline/_pipeline.py @@ -514,10 +514,9 @@ def load(path): .build(num_threads=10) ) - with pipeline.auto_stop(): - for item in pipeline.get_iterator(timeout=30): - # do something with the decoded image - ... + for item in pipeline.get_iterator(timeout=30): + # do something with the decoded image + ... A ``Pipeline`` cleans up its background thread and worker processes automatically, so a forgotten pipeline will not hang the process at exit: it @@ -532,11 +531,11 @@ def load(path): .. versionchanged:: 0.4.0 - **[Experimental]** Calling :py:meth:`start` and :py:meth:`stop` is now - optional. When iterating a pipeline that has not been explicitly started, + Calling :py:meth:`start` and :py:meth:`stop` is now optional. + When iterating a pipeline that has not been explicitly started, the background thread is started automatically on the first item request. When the ``Pipeline`` object is garbage collected, the background thread - is stopped automatically via :py:func:`weakref.finalize`. + is stopped automatically via :py:class:`weakref.finalize`. Explicit :py:meth:`start` / :py:meth:`stop` and the :py:meth:`auto_stop` context manager continue to work as before.