-
-
Notifications
You must be signed in to change notification settings - Fork 540
How to exit loop running? #425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Do you have any internal timeout parameter? async for message in ws:
print(message) if websocket is frozen, this code will pause/wait for ever. you can try shutdown you network for 10 seconds and re-enable it. |
Thank you for your professional answer. |
I'm not sure if you're sincere or sarcastic :-| You got the "best effort in my free time" answer and I believe the docs are the best answer I have to your question. The way you phrased your first question — "How to exit the loop event - run_forever() in my own function?" — suggests it's more a question about asyncio than about websockets. Your second question — "Do you have any internal timeout parameter?" — is answered by the example I linked to: use asyncio.wait_for. You can have a more personalized answer in my paid-for time if you'd like. See "Professional support" in the README. |
Perhaps this is a duplicate of #414. |
I'm sorry to cost your working time. You answer really helped me. It's my fault that I didn't read the docs carefully. In my mind, you can add more full samples to help others to use websockets. I just finished my program, can you help to put it on the site? Of course, you can help to review the code. |
Thanks for clarifying :-) Sometimes it's hard to tell across the language barrier. |
I'm running websocket client in my MacOS. Everything is OK after running.
Then I shutdown the wifi connection for 10 seconds, and re-connect to wifi .
I found that my application is dead....
So, How to exit the loop event - run_forever() in my own function? thanks.
The text was updated successfully, but these errors were encountered: