Always do symbol unsubscribe on teardown
parent
73eedfd7b3
commit
f4a91a4975
|
@ -391,6 +391,7 @@ async def _async_main(name, portal, tickers, brokermod, rate):
|
||||||
"piker.brokers.core", 'start_quote_stream',
|
"piker.brokers.core", 'start_quote_stream',
|
||||||
broker=brokermod.name, tickers=tickers)
|
broker=brokermod.name, tickers=tickers)
|
||||||
|
|
||||||
|
try:
|
||||||
async with trio.open_nursery() as nursery:
|
async with trio.open_nursery() as nursery:
|
||||||
# get first quotes response
|
# get first quotes response
|
||||||
log.debug("Waiting on first quote...")
|
log.debug("Waiting on first quote...")
|
||||||
|
@ -459,6 +460,8 @@ async def _async_main(name, portal, tickers, brokermod, rate):
|
||||||
# Trio-kivy entry point.
|
# Trio-kivy entry point.
|
||||||
await async_runTouchApp(widgets['root']) # run kivy
|
await async_runTouchApp(widgets['root']) # run kivy
|
||||||
await agen.aclose() # cancel aysnc gen call
|
await agen.aclose() # cancel aysnc gen call
|
||||||
|
finally:
|
||||||
|
# un-subscribe from symbols stream
|
||||||
await portal.run(
|
await portal.run(
|
||||||
"piker.brokers.core", 'modify_quote_stream',
|
"piker.brokers.core", 'modify_quote_stream',
|
||||||
broker=brokermod.name, tickers=[])
|
broker=brokermod.name, tickers=[])
|
||||||
|
|
Loading…
Reference in New Issue