From fa455f9c248c5f692697d6b7bd94511e5b10887a Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 26 Jul 2020 00:35:41 -0400 Subject: [PATCH] Revert removal of `infect_asyncio` in nursery start methods --- tractor/__init__.py | 2 ++ tractor/_trionics.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/tractor/__init__.py b/tractor/__init__.py index 5ed843f..dda1400 100644 --- a/tractor/__init__.py +++ b/tractor/__init__.py @@ -22,6 +22,7 @@ from ._exceptions import RemoteActorError, ModuleNotExposed from ._debug import breakpoint, post_mortem from . import msg from . import _spawn +from . import to_asyncio __all__ = [ @@ -39,6 +40,7 @@ __all__ = [ 'RemoteActorError', 'ModuleNotExposed', 'msg' + 'to_asyncio' ] diff --git a/tractor/_trionics.py b/tractor/_trionics.py index 203a9dc..e0610bc 100644 --- a/tractor/_trionics.py +++ b/tractor/_trionics.py @@ -56,6 +56,7 @@ class ActorNursery: rpc_module_paths: List[str] = None, loglevel: str = None, # set log level per subactor nursery: trio.Nursery = None, + infect_asyncio: bool = False, ) -> Portal: loglevel = loglevel or self._actor.loglevel or get_loglevel() @@ -89,6 +90,7 @@ class ActorNursery: bind_addr, parent_addr, _rtv, # run time vars + infect_asyncio=infect_asyncio, ) ) @@ -101,6 +103,7 @@ class ActorNursery: rpc_module_paths: Optional[List[str]] = None, statespace: Dict[str, Any] = None, loglevel: str = None, # set log level per subactor + infect_asyncio: bool = False, **kwargs, # explicit args to ``fn`` ) -> Portal: """Spawn a new actor, run a lone task, then terminate the actor and @@ -119,6 +122,7 @@ class ActorNursery: loglevel=loglevel, # use the run_in_actor nursery nursery=self._ria_nursery, + infect_asyncio=infect_asyncio, ) # this marks the actor to be cancelled after its portal result # is retreived, see logic in `open_nursery()` below.