Port to new @tractor.stream API

kivy_mainline_and_py3.8
Tyler Goodlet 2019-04-26 00:27:01 -04:00
parent 811dbaab4e
commit 49d612de49
1 changed files with 5 additions and 1 deletions

View File

@ -28,7 +28,10 @@ from . import get_brokermod
log = get_logger('broker.data') log = get_logger('broker.data')
async def wait_for_network(net_func: Callable, sleep: int = 1) -> dict: async def wait_for_network(
net_func: Callable,
sleep: int = 1
) -> dict:
"""Wait until the network (DNS) comes back up. """Wait until the network (DNS) comes back up.
""" """
down = False down = False
@ -251,6 +254,7 @@ async def get_cached_feed(
await feed.exit_stack.aclose() await feed.exit_stack.aclose()
@tractor.stream
async def start_quote_stream( async def start_quote_stream(
ctx: tractor.Context, # marks this as a streaming func ctx: tractor.Context, # marks this as a streaming func
broker: str, broker: str,