From 6f5a2654ab0acb9f2af61b335b7a8bceea27d4f6 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 18 Apr 2023 19:04:00 -0400 Subject: [PATCH] Port `.clearing` to new `unpack_fqme()` --- piker/clearing/_client.py | 2 +- piker/clearing/_ems.py | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/piker/clearing/_client.py b/piker/clearing/_client.py index a2835183..a9f0fb23 100644 --- a/piker/clearing/_client.py +++ b/piker/clearing/_client.py @@ -238,7 +238,7 @@ async def open_ems( broker control client-API. ''' - broker, symbol, suffix = unpack_fqme(fqme) + broker, mktep, venue, suffix = unpack_fqme(fqme) async with maybe_open_emsd( broker, diff --git a/piker/clearing/_ems.py b/piker/clearing/_ems.py index 0d666ef0..fdb1986a 100644 --- a/piker/clearing/_ems.py +++ b/piker/clearing/_ems.py @@ -383,7 +383,7 @@ class Router(Struct): brokermod: ModuleType, portal: tractor.Portal, exec_mode: str, - symbol: str, + fqme: str, loglevel: str, ) -> None: @@ -424,7 +424,7 @@ class Router(Struct): # actor to simulate the real IPC load it'll have when also # pulling data from feeds open_trades_endpoint = paper.open_paperboi( - fqme='.'.join([symbol, broker]), + fqme=fqme, loglevel=loglevel, ) @@ -522,15 +522,13 @@ class Router(Struct): indefinitely. ''' - broker, symbol, suffix = unpack_fqme(fqme) - async with ( maybe_open_feed( [fqme], loglevel=loglevel, ) as feed, ): - brokername, _, _ = unpack_fqme(fqme) + brokername, _, _, _ = unpack_fqme(fqme) brokermod = feed.mods[brokername] broker = brokermod.name portal = feed.portals[brokermod] @@ -545,7 +543,7 @@ class Router(Struct): brokermod=brokermod, portal=portal, exec_mode=exec_mode, - symbol=symbol, + fqme=fqme, loglevel=loglevel, ) as relay: @@ -1435,7 +1433,7 @@ async def _emsd_main( global _router assert _router - broker, symbol, suffix = unpack_fqme(fqme) + broker, _, _, _ = unpack_fqme(fqme) # TODO: would be nice if in tractor we can require either a ctx arg, # or a named arg with ctx in it and a type annotation of