`binance`: use built-in `anext()` add note about new ws ep URL

binance_ws_ep_update
Tyler Goodlet 2023-02-28 12:46:29 -05:00
parent f3b04f27e6
commit 9197e6decb
1 changed files with 5 additions and 3 deletions

View File

@ -531,17 +531,19 @@ async def stream_quotes(
async with open_autorecon_ws( async with open_autorecon_ws(
'wss://stream.binance.com/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, fixture=subscribe,
) as ws: ) as ws:
# pull a first quote and deliver # pull a first quote and deliver
msg_gen = stream_messages(ws) msg_gen = stream_messages(ws)
typ, quote = await msg_gen.__anext__() typ, quote = await anext(msg_gen)
while typ != 'trade': while typ != 'trade':
# TODO: use ``anext()`` when it lands in 3.10! typ, quote = await anext(msg_gen)
typ, quote = await msg_gen.__anext__()
task_status.started((init_msgs, quote)) task_status.started((init_msgs, quote))