Python twisted.internet.reactor 模块,removeAll() 实例源码

我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用twisted.internet.reactor.removeAll()

项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def do_cleanReactor(cls):
        s = []
        from twisted.internet import reactor
        removedSelectables = reactor.removeAll()
        if removedSelectables:
            s.append(DIRTY_REACTOR_MSG)
            for sel in removedSelectables:
                if interfaces.IProcessTransport.providedBy(sel):
                    sel.signalProcess('KILL')
                s.append(repr(sel))
        if s:
            raise DirtyReactorError(' '.join(s))
项目:sslstrip-hsts-openwrt    作者:adde88    | 项目源码 | 文件源码
def do_cleanReactor(cls):
        s = []
        from twisted.internet import reactor
        removedSelectables = reactor.removeAll()
        if removedSelectables:
            s.append(DIRTY_REACTOR_MSG)
            for sel in removedSelectables:
                if interfaces.IProcessTransport.providedBy(sel):
                    sel.signalProcess('KILL')
                s.append(repr(sel))
        if s:
            raise DirtyReactorError(' '.join(s))
项目:asgi_redis    作者:django    | 项目源码 | 文件源码
def tearDown(self):
        del self.channel_layer
        reactor.removeAll()
        super(TwistedTests, self).tearDown()
项目:asgi_rabbitmq    作者:proofit404    | 项目源码 | 文件源码
def tearDown(self):

        reactor.removeAll()
        super(RabbitmqChannelLayerTwistedTest, self).tearDown()
项目:zenchmarks    作者:squeaky-pl    | 项目源码 | 文件源码
def _cleanReactor(self):
        """
        Remove all selectables from the reactor, kill any of them that were
        processes, and return their string representation.
        """
        reactor = self._getReactor()
        selectableStrings = []
        for sel in reactor.removeAll():
            if interfaces.IProcessTransport.providedBy(sel):
                sel.signalProcess('KILL')
            selectableStrings.append(repr(sel))
        return selectableStrings