From 9197e6decb35c08f5ff6515f816bd45087716cbb Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 28 Feb 2023 12:46:29 -0500 Subject: [PATCH] `binance`: use built-in `anext()` add note about new ws ep URL --- piker/brokers/binance.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/piker/brokers/binance.py b/piker/brokers/binance.py index 0c177db8..46da1f37 100644 --- a/piker/brokers/binance.py +++ b/piker/brokers/binance.py @@ -531,17 +531,19 @@ async def stream_quotes( async with open_autorecon_ws( 'wss://stream.binance.com/ws', + # XXX: see api docs which show diff addr? + # https://developers.binance.com/docs/binance-trading-api/websocket_api#general-api-information + # 'wss://ws-api.binance.com:443/ws-api/v3', fixture=subscribe, ) as ws: # pull a first quote and deliver msg_gen = stream_messages(ws) - typ, quote = await msg_gen.__anext__() + typ, quote = await anext(msg_gen) while typ != 'trade': - # TODO: use ``anext()`` when it lands in 3.10! - typ, quote = await msg_gen.__anext__() + typ, quote = await anext(msg_gen) task_status.started((init_msgs, quote))