I'm trying to open two web sockets - depth book and user socket.
Here's my code:
async def sockets(client):
bm = BinanceSocketManager(client)
ds = bm.depth_socket("BTCUSDT", depth=BinanceSocketManager.WEBSOCKET_DEPTH_5)
print("Started...")
async with ds as depth_socket:
while True:
res = await depth_socket.recv()
print(res)
await client.close_connection()
I need bm.user_socket() socket to be opened as well at the same time.
How can I have two of them opened at the same time with BinanceSocketManager?
from Two websockets with BinanceSocketManager
No comments:
Post a Comment