From 937406534c02044477b03408ac64eff7517c1fb1 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 17 Mar 2022 09:03:44 -0400 Subject: [PATCH] Maybe spawn `brokerd` in `asyncio` mode if declared in backend mod --- piker/brokers/core.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/piker/brokers/core.py b/piker/brokers/core.py index b16f46fe..af5da3a1 100644 --- a/piker/brokers/core.py +++ b/piker/brokers/core.py @@ -142,15 +142,23 @@ async def symbol_search( brokermods: list[ModuleType], pattern: str, **kwargs, + ) -> Dict[str, Dict[str, Dict[str, Any]]]: - """Return symbol info from broker. - """ + ''' + Return symbol info from broker. + + ''' results = [] - async def search_backend(brokername: str) -> None: + async def search_backend( + brokermod: ModuleType + ) -> None: + + brokername: str = mod.name async with maybe_spawn_brokerd( - brokername, + mod.name, + infect_asyncio=getattr(mod, '_infect_asyncio', False), ) as portal: results.append((