Take the 2-minute tour ×

I have an application which is stuck in a file.read call. Before it goes into a loop where this call is made it forks a child which starts a gevent WSGI server. The purpose of this setup is that I want to wait for a keystroke, send this keystroke to the child websocket server which spreads the message among other connected websocket-clients. My problem is that I don't know how to stop this thing.

If I Ctrl+C the child server process gets the sigint and stops. But my parent only responds if it can read something out of his file. Isn't there something like an asynchronous handler? I also tried registering for SIGINT via signal.signal and manually sending the signal, but the signal handler was only called if something was written to the file.

BTW: I'm runnning Linux.

share|improve this question
possibly a dup of stackoverflow.com/questions/11312525/… –  cmd Jun 19 '13 at 21:02
Re your deleted question: If you are already advanced in another language, how about a tutorial from one of the modern PHP frameworks? Symfony2, Zend, Laravel, Slim probably all have something you can work through. I did the tutorial for symfony 1.x, and it was a great learning experience. –  halfer Sep 30 '13 at 22:21
add comment


Your Answer



Browse other questions tagged or ask your own question.