Replies: 1 comment
-
Congrats on your first app. asyncio doesn't offer an way of reading from file descriptors, only sockets. Only the exit event is polled 10 times a second, which takes negligible CPU. The input uses a selector, so that it can respond to input as it arrives. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've just finished my first app, and looked at strace output for another reason. I see that the process has two threads, with one of them polling on stdin in a 0.1s interval. Apparently, the polling is done so that the thread notices a quit-request within at most 0.1s.
Why is this? Can't terminal input be taken from within asyncio's event loop , without polling?
Thanks,
Joerg
Beta Was this translation helpful? Give feedback.
All reactions