s/tickers/symbols

kivy_mainline_and_py3.8
Tyler Goodlet 2018-12-01 16:12:03 -05:00
parent 2915e83324
commit 7378a16b90
2 changed files with 6 additions and 6 deletions

View File

@ -233,23 +233,23 @@ async def smoke_quote(get_quotes, tickers, broker):
########################################### ###########################################
async def modify_quote_stream(broker, feed_type, tickers, chan=None, cid=None): async def modify_quote_stream(broker, feed_type, symbols, chan=None, cid=None):
"""Absolute symbol subscription list for each quote stream. """Absolute symbol subscription list for each quote stream.
Effectively a symbol subscription api. Effectively a symbol subscription api.
""" """
log.info(f"{chan} changed symbol subscription to {tickers}") log.info(f"{chan} changed symbol subscription to {symbols}")
feed = await get_cached_feed(broker) feed = await get_cached_feed(broker)
symbols2chans = feed.subscriptions[feed_type] symbols2chans = feed.subscriptions[feed_type]
# update map from each symbol to requesting client's chan # update map from each symbol to requesting client's chan
for ticker in tickers: for ticker in symbols:
symbols2chans.setdefault(ticker, set()).add((chan, cid)) symbols2chans.setdefault(ticker, set()).add((chan, cid))
# remove any existing symbol subscriptions if symbol is not # remove any existing symbol subscriptions if symbol is not
# found in ``tickers`` # found in ``symbols``
# TODO: this can likely be factored out into the pub-sub api # TODO: this can likely be factored out into the pub-sub api
for ticker in filter( for ticker in filter(
lambda ticker: ticker not in tickers, symbols2chans.copy() lambda ticker: ticker not in symbols, symbols2chans.copy()
): ):
chanset = symbols2chans.get(ticker) chanset = symbols2chans.get(ticker)
# XXX: cid will be different on unsub call # XXX: cid will be different on unsub call

View File

@ -615,7 +615,7 @@ async def _async_main(
"piker.brokers.data", 'modify_quote_stream', "piker.brokers.data", 'modify_quote_stream',
broker=brokermod.name, broker=brokermod.name,
feed_type='stock', feed_type='stock',
tickers=[] symbols=[]
) )
# cancel GUI update task # cancel GUI update task