开发者

Registering Thread Exit Callback for Pylons Threads

We have a Pylons WSGI app that lazily creates connections to a resource. That is to say, it uses a threading.local instance to see if a connection exists for the thread and creates one if it does not.

This solves the trick of o开发者_运维百科pening connections, but how can I close my connections properly when the thread exits? I can't find any information about how to be alerted when a thread is being terminated.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜