File tree Expand file tree Collapse file tree
docs/source/reference/API Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ These function decorators can be added to member functions of an ezmsg ``Unit``
1111
1212.. autodecorator :: ezmsg.core.thread
1313
14+ .. note ::
15+ ``@ez.thread `` is deprecated and will be removed in a future release.
16+ Prefer explicit background work via ``loop.run_in_executor(...) ``.
17+
1418.. autodecorator :: ezmsg.core.task
1519
1620.. autodecorator :: ezmsg.core.process
Original file line number Diff line number Diff line change @@ -274,11 +274,22 @@ def thread(func: Callable):
274274 Thread functions run concurrently with the main message processing and can be used
275275 for background tasks, monitoring, or other concurrent operations.
276276
277+ .. deprecated::
278+ ``@thread`` is deprecated and will be removed in a future release.
279+ Prefer explicit background work using ``loop.run_in_executor(...)`` or
280+ explicit task management in ``initialize()``/``shutdown()``.
281+
277282 :param func: The function to run as a background thread
278283 :type func: collections.abc.Callable
279284 :return: The decorated function
280285 :rtype: collections.abc.Callable
281286 """
287+ warnings .warn (
288+ "`@ez.thread` is deprecated and will be removed in a future release. "
289+ "Prefer explicit background work via `loop.run_in_executor(...)`." ,
290+ DeprecationWarning ,
291+ stacklevel = 2 ,
292+ )
282293 setattr (func , THREAD_ATTR , True )
283294 return func
284295
You can’t perform that action at this time.
0 commit comments