Non-blocking stdin with python using epoll
I was playing with epoll
and was curious whether I can use it to monitor
sys.stdin
. The biggest issue was that sys.stdin.read()
is blocking and I
had no way to figure out whether I read the descriptor fully or not (making the
epoll
useless pretty much). Until I changed it to non-blocking with fcntl
.