Python源码示例:twisted.internet.reactor.removeAll()
示例1
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
示例2
def tearDown(self):
os.environ.pop("SENTRY_DSN", None)
reactor.removeAll()
示例3
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
示例4
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
示例5
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))
示例6
def _cleanSelectables(self):
"""Remove all selectables and return their string representation.
Kill any of them that were processes.
"""
for sel in reactor.removeAll():
if interfaces.IProcessTransport.providedBy(sel):
sel.signalProcess("KILL")
yield sel