def __init__(self, reactor, transactionFactory, useWorkerPool=True, disableWorkProcessing=False):
"""
Initialize a L{ControllerQueue}.
@param transactionFactory: a 0- or 1-argument callable that produces an
L{IAsyncTransaction}
@param useWorkerPool: Whether to use a worker pool to manage load
or instead take on all work ourselves (e.g. in single process mode)
"""
super(ControllerQueue, self).__init__()
self.reactor = reactor
self.transactionFactory = transactionFactory
self.workerPool = WorkerConnectionPool() if useWorkerPool else None
self.disableWorkProcessing = disableWorkProcessing
self._lastMinPriority = WORK_PRIORITY_LOW
self._timeOfLastWork = time.time()
self._actualPollInterval = self.queuePollInterval
self._inWorkCheck = False
self._inOverdueCheck = False
评论列表
文章目录