class GracefulSite(server.Site): protocol = GracefulHTTPChannel def __init__(self, *args, **kwargs): server.Site.__init__(self, *args, **kwargs) self.connection_pool = DeferredPool() def trackConnection(self): d = Deferred() self.connection_pool.add(d) return d def waitForOutstandingConnections(self): return self.connection_pool.notifyWhenEmpty() def stopFactory(self): server.Site.stopFactory(self) log.msg("stopFactory called", logLevel=logging.CRITICAL)
class GracefulSite(server.Site): protocol = GracefulHTTPChannel def __init__(self, *args, **kwargs): server.Site.__init__(self, *args, **kwargs) self.connection_pool = DeferredPool() def trackConnection(self): d = Deferred() self.connection_pool.add(d) return d def waitForOutstandingConnections(self): return self.connection_pool.notifyWhenEmpty() def stopFactory(self): server.Site.stopFactory(self) log.msg("stopFactory called", logLevel=logging.CRITICAL)
def __init__(self, *args, **kwargs): server.Site.__init__(self, *args, **kwargs) self.connection_pool = DeferredPool()
def __init__(self, *args, **kwargs): server.Site.__init__(self, *args, **kwargs) self.connection_pool = DeferredPool()
def __init__(self, site, *args, **kwargs): internet.TCPServer.__init__(self, 0, site, *args, **kwargs) self.connections = DeferredPool() self.site = site