These are chat archives for cherrypy/cherrypy

15th
Jun 2016
Paulo Vital
@pvital
Jun 15 2016 14:57
Hey guys. I'd like to know if there's a way to create listeners to process signals from system (Linux) without using cherrypy.engine.block() ??? When I remove block() from my code, I can see that the CPU usage decreases a lot, but I still need a way to handle signals.
Joseph S. Tate
@josephtate
Jun 15 2016 16:33
@pvital you need to write your own wait loop then. engine.block() keeps the main thread open and waiting so that the signal handlers can be reached. If you don't block, the main thread just exits so all the signal handlers get reaped. You also lose the timer engine functionality, and engine plugins.
Maybe there's some optimization you can do inside engine.block to drop the CPU usage?
We'd love a patch if you discover something.
Paulo Vital
@pvital
Jun 15 2016 19:56
@josephtate, yeah all my experiments to develop my own way to handle the signals are not working.
will start to look on optimize engine.block()