I couldn’t find this in the docs, but how am I meant to break out of the asyncore.loop() without using signals?
I couldn’t find this in the docs , but how am I meant to
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That was quick to work out after looking at the source code. Thanks to the docs for linking directly to the source!
There is an ExitNow exception you can simply raise from the app, which exits the loop.
Using the
EchoHandlerexample from the docs, I’ve modified it to quit immediately when receiving data.Also, keep in mind that you can catch
ExitNowso your app doesn’t raise if you’re using it internally. This is some of my source: