def make(self, dependency_resources):
"""Create and start a new thread pool."""
from twisted.internet import reactor
global _threadPool
if _threadPool is None:
_threadPool = ThreadPool(minthreads=1, maxthreads=1)
reactor.callWhenRunning(_threadPool.start)
reactor.addSystemEventTrigger('during', 'shutdown',
_threadPool.stop)
return _threadPool
评论列表
文章目录