Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
 def __init__(self, *args, **kwargs):
     server.Site.__init__(self, *args, **kwargs)
     self.connection_pool = DeferredPool()
Ejemplo n.º 4
0
 def __init__(self, *args, **kwargs):
     server.Site.__init__(self, *args, **kwargs)
     self.connection_pool = DeferredPool()
Ejemplo n.º 5
0
 def __init__(self, site, *args, **kwargs):
     internet.TCPServer.__init__(self, 0, site, *args, **kwargs)
     self.connections = DeferredPool()
     self.site = site