Type loaded backend modules

brokers_refinery
Tyler Goodlet 2025-02-13 10:44:23 -05:00
parent 3edb6926e4
commit 8b61b4e79b
1 changed files with 4 additions and 3 deletions

View File

@ -98,13 +98,14 @@ async def open_cached_client(
If one has not been setup do it and cache it.
'''
brokermod = get_brokermod(brokername)
brokermod: ModuleType = get_brokermod(brokername)
# TODO: make abstract or `typing.Protocol`
# client: Client
async with maybe_open_context(
acm_func=brokermod.get_client,
kwargs=kwargs,
) as (cache_hit, client):
if cache_hit:
log.runtime(f'Reusing existing {client}')