1
金字塔支持ApplicationCreated
事件。但是我找不到任何ApplicationDestroyed
/ApplicationShutdown
事件。完全可能在关机后执行一个功能。金字塔停机时运行代码
除了进一步了解我的堆栈之外,我还有其他选择吗?我在uWSGI里面使用gevent。可能有gevent或uWSGI来运行我的关闭代码,但它肯定不是很漂亮。
金字塔支持ApplicationCreated
事件。但是我找不到任何ApplicationDestroyed
/ApplicationShutdown
事件。完全可能在关机后执行一个功能。金字塔停机时运行代码
除了进一步了解我的堆栈之外,我还有其他选择吗?我在uWSGI里面使用gevent。可能有gevent或uWSGI来运行我的关闭代码,但它肯定不是很漂亮。
金字塔不支持任何关机事件。
但是Python有一个atexit
事件,那就解释关机运行
http://docs.python.org/library/atexit.html
import atexit
@atexit.register
def goodbye():
print "You are now leaving the Python sector."