client_uf = UMFuturesWebsocketClient(on_message=message_handler)
client_uf.user_data(listen_key=listen_key, id=1,)
print("start")
time.sleep(100)
client_uf.stop()
client.close_listen_key(listen_key)
print("close")
how i can run this code like
loop = asyncio.get_event_loop()
It seems like you want to run the provided code using an asynchronous approach with asyncio
and an event loop in python. However, I’m not sure if you can actually achieve that because UMFuturesWebsocketClient
is not build with async
( not compatible with asyncio
). There’s probably solutions for what you want to achieve, but this is a programming question and this forum is more for API questions itself, so I would suggest try to research more on your own online. Apologies and thank you.