28 Aug
2013
28 Aug
'13
7:09 p.m.
I didn't read over your code, but this is something that I've independently implemented. You can see my implementation at https://github.com/habnabit/polecat/blob/master/polecat.py. The Site subclass does some other monitoring-related things, but you should be able to tease out just the graceful shutdown parts if that's all you want. Polecat needs some work and a lot of documentation, but for now, the way to do a graceful shutdown is to make a PolecatSite and then addSystemEventTrigger('before', 'shutdown', yourPolecatSite.gracefullyStopActiveClients).