Acquire symbol data with daemon; push as first response

kivy_mainline_and_py3.8
Tyler Goodlet 2018-05-08 15:39:57 -04:00
parent 5a9c079c10
commit fcaeeae618
1 changed files with 8 additions and 2 deletions

View File

@ -325,13 +325,19 @@ async def start_quoter(
log.warn(f"Retrieving smoke quote for {queue.peer}") log.warn(f"Retrieving smoke quote for {queue.peer}")
quotes = await get_quotes(tickers) quotes = await get_quotes(tickers)
# pop any tickers that aren't returned in the first quote # pop any tickers that aren't returned in the first quote
tickers = set(tickers) - set(quotes) valid_tickers = set(tickers) - set(quotes)
for ticker in tickers: for ticker in valid_tickers:
log.warn( log.warn(
f"Symbol `{ticker}` not found by broker `{brokermod.name}`" f"Symbol `{ticker}` not found by broker `{brokermod.name}`"
) )
tickers2qs.pop(ticker, None) tickers2qs.pop(ticker, None)
# first respond with symbol data for all tickers (allows
# clients to receive broker specific setup info)
sd = await client.symbol_data(tickers)
assert sd, "No symbol data could be found?"
await queue.put(sd)
# pop any tickers that return "empty" quotes # pop any tickers that return "empty" quotes
payload = {} payload = {}
for symbol, quote in quotes.items(): for symbol, quote in quotes.items():