def __init__(self): MultiService.__init__(self) # Dispatcher self.dispatcher = InheritedSocketDispatcher(self) # Child Processes self.log.info("Setting up master/child spawning service...") self.spawningService = ChildSpawningService(self.dispatcher) self.spawningService.setServiceParent(self)
def __init__(self, maxAccepts, maxRequests): """ Create a L{ConnectionLimiter} with an associated dispatcher and list of factories. """ MultiService.__init__(self) self.factories = [] # XXX dispatcher needs to be a service, so that it can shut down its # sub-sockets. self.dispatcher = InheritedSocketDispatcher(self) self.maxAccepts = maxAccepts self.maxRequests = maxRequests self.overloaded = False
def setUp(self): self.dispatcher = InheritedSocketDispatcher(ConnectionLimiter(2, 20)) self.dispatcher.reactor = ReaderAdder()