阅读背景:

如何在客户端线程退出时检测到?

来源:互联网 

Here’s an interesting library writer’s dilemma. In my library (in my case EasyNetQ) I’m assigning thread local resources. So when a client creates a new thread and then calls certain methods on my library new resources get created. In the case of EasyNetQ a new channel to the RabbitMQ server is created when the client calls ‘Publish’ on a new thread. I want to be able to detect when the client thread exits so that I can clean up the resources (channels).Here’s an interesting library writer’s dilemma.




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: