Add note about expecting client side to cache search domain?

basic_buy_bot
Tyler Goodlet 2023-06-16 20:48:19 -04:00
parent c6d1007e66
commit 43494e4994
1 changed files with 6 additions and 2 deletions

View File

@ -470,18 +470,22 @@ async def open_symbol_search(
# load all symbols locally for fast search # load all symbols locally for fast search
fqpairs_cache = await client.exch_info() 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() await ctx.started()
async with ctx.open_stream() as stream: async with ctx.open_stream() as stream:
pattern: str
async for pattern in stream: async for pattern in stream:
# results = await client.exch_info(sym=pattern.upper())
matches = fuzzy.extractBests( matches = fuzzy.extractBests(
pattern, pattern,
fqpairs_cache, fqpairs_cache,
score_cutoff=50, score_cutoff=50,
) )
# repack in dict form # repack in dict form
await stream.send({ await stream.send({
item[0].bs_fqme: item[0] item[0].bs_fqme: item[0]