From 43494e4994ea176858092273277900d036db77cd Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 16 Jun 2023 20:48:19 -0400 Subject: [PATCH] Add note about expecting client side to cache search domain? --- piker/brokers/binance/feed.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/piker/brokers/binance/feed.py b/piker/brokers/binance/feed.py index 7a0a80b3..84e0914b 100644 --- a/piker/brokers/binance/feed.py +++ b/piker/brokers/binance/feed.py @@ -470,18 +470,22 @@ async def open_symbol_search( # load all symbols locally for fast search fqpairs_cache = await client.exch_info() + # TODO: maybe we should deliver the cache + # so that client's can always do a local-lookup-first + # style try and then update async as (new) match results + # are delivered from here? await ctx.started() async with ctx.open_stream() as stream: + pattern: str async for pattern in stream: - # results = await client.exch_info(sym=pattern.upper()) - matches = fuzzy.extractBests( pattern, fqpairs_cache, score_cutoff=50, ) + # repack in dict form await stream.send({ item[0].bs_fqme: item[0]