Twisted: Creating a ThreadPool and then daemonizing leads to uninformative hangs

戏子无情 提交于 2019-11-30 20:59:46

Return a MultiService from your ServiceMaker; one that includes your ThreadPoolService as well as your main application service. The API for assembling such a thing is pretty straightforward:

multi = MultiService()
mine = TCPServer(...) # your existing application service
threads = ThreadPoolService()
mine.setServiceParent(multi)
threads.setServiceParent(multi)
return multi

Given that you've already found the ticket for dealing with this confusing issue within Twisted, I look forward to seeing your patch :).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!