I'm running a websocket listener in a separate thread. I'd like to connect to the websocket then do:
while True:
msg = sock.wait_for_message()
f(msg)
i.e. no async/asyncio
Is this stupid? Is there a way to do this?
In absence of a better answer, I have found https://github.com/websocket-client/websocket-client which prove painless to use.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With