Pyramid supports an ApplicationCreated event. However I can’t find any ApplicationDestroyed/ApplicationShutdown event. Is it at all possible do execute a function upon shutdown.
Do I have any choice other than to go further up my stack: ie. I’m using gevent inside uWSGI. It might be possible to get gevent or uWSGI to run my shutdown code, but it certainly isn’t as pretty.
Pyramid does not support any shutdown event.
However Python has a
atexitevent, that runs on interpreter shutdownhttp://docs.python.org/library/atexit.html