From 1406ddc5ee5c16af1c30be17e03798bd8228fa26 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 26 Jul 2020 00:35:41 -0400 Subject: [PATCH] Add `infect_asyncio: bool` flag to nursery methods --- tractor/_supervise.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tractor/_supervise.py b/tractor/_supervise.py index 36e05b5..5725338 100644 --- a/tractor/_supervise.py +++ b/tractor/_supervise.py @@ -81,6 +81,7 @@ class ActorNursery: loglevel: str = None, # set log level per subactor nursery: trio.Nursery = None, debug_mode: Optional[bool] = None, + infect_asyncio: bool = False, ) -> Portal: ''' Start a (daemon) actor: an process that has no designated @@ -134,6 +135,7 @@ class ActorNursery: bind_addr, parent_addr, _rtv, # run time vars + infect_asyncio=infect_asyncio, ) ) @@ -146,6 +148,7 @@ class ActorNursery: rpc_module_paths: Optional[List[str]] = None, enable_modules: List[str] = 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 @@ -170,6 +173,7 @@ class ActorNursery: loglevel=loglevel, # use the run_in_actor nursery nursery=self._ria_nursery, + infect_asyncio=infect_asyncio, ) # XXX: don't allow stream funcs