From 03e429abf844a80493506c1f71dcb09bc7dcd763 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 4 Jan 2024 09:59:15 -0500 Subject: [PATCH] Extend `enable_modules` from input `tractor_kwargs` Since certain actors (even if client-like) will want to augment their module set to provide remote features (such as our new rc annotation msg-prot for `Qt`-chart actors) we need to ensure we merge in any input `enable_modules: list[str]` to the value passed to the underlying `tractor` spawning api. Previously we were passing `_root_modules` as this value by name, but now instead we simply `list.extend()` that into whatever is in the `kwargs` both in `open_piker_runtime()` and `open_pikerd()`. --- piker/service/_actor_runtime.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/piker/service/_actor_runtime.py b/piker/service/_actor_runtime.py index e713fe43..a4e3ccf2 100644 --- a/piker/service/_actor_runtime.py +++ b/piker/service/_actor_runtime.py @@ -100,7 +100,7 @@ async def open_piker_runtime( or [_default_reg_addr] ) - if ems := tractor_kwargs.get('enable_modules'): + if ems := tractor_kwargs.pop('enable_modules', None): # import pdbp; pdbp.set_trace() enable_modules.extend(ems) @@ -175,14 +175,20 @@ async def open_pikerd( alive underling services (see below). ''' + # NOTE: for the root daemon we always enable the root + # mod set and we `list.extend()` it into wtv the + # caller requested. + # TODO: make this mod set more strict? + # -[ ] eventually we should be able to avoid + # having the root have more then permissions to spawn other + # specialized daemons I think? + ems: list[str] = kwargs.setdefault('enable_modules', []) + ems.extend(_root_modules) + async with ( open_piker_runtime( name=_root_dname, - # TODO: eventually we should be able to avoid - # having the root have more then permissions to - # spawn other specialized daemons I think? - enable_modules=_root_modules, loglevel=loglevel, debug_mode=debug_mode, registry_addrs=registry_addrs,