From 49d612de49327e0d4604a68f32c8b28a1fbe37c4 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 26 Apr 2019 00:27:01 -0400 Subject: [PATCH] Port to new @tractor.stream API --- piker/brokers/data.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/piker/brokers/data.py b/piker/brokers/data.py index 0d2a04b8..51444917 100644 --- a/piker/brokers/data.py +++ b/piker/brokers/data.py @@ -28,7 +28,10 @@ from . import get_brokermod 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. """ down = False @@ -251,6 +254,7 @@ async def get_cached_feed( await feed.exit_stack.aclose() +@tractor.stream async def start_quote_stream( ctx: tractor.Context, # marks this as a streaming func broker: str,