def __init__(self, coordinator, failTest, newWorker, *args, **kwargs):
"""
Initialize this L{MemoryPool} with a test case.
@param coordinator: a worker used to coordinate work in the L{Team}
underlying this threadpool.
@type coordinator: L{twisted._threads.IExclusiveWorker}
@param failTest: A 1-argument callable taking an exception and raising
a test-failure exception.
@type failTest: 1-argument callable taking (L{Failure}) and raising
L{unittest.FailTest}.
@param newWorker: a 0-argument callable that produces a new
L{twisted._threads.IWorker} provider on each invocation.
@type newWorker: 0-argument callable returning
L{twisted._threads.IWorker}.
"""
self._coordinator = coordinator
self._failTest = failTest
self._newWorker = newWorker
threadpool.ThreadPool.__init__(self, *args, **kwargs)
评论列表
文章目录