本文整理匯總了Python中twisted.internet.error.ReactorNotRunning方法的典型用法代碼示例。如果您正苦於以下問題:Python error.ReactorNotRunning方法的具體用法?Python error.ReactorNotRunning怎麽用?Python error.ReactorNotRunning使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類twisted.internet.error
的用法示例。
在下文中一共展示了error.ReactorNotRunning方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: goodbye
# 需要導入模塊: from twisted.internet import error [as 別名]
# 或者: from twisted.internet.error import ReactorNotRunning [as 別名]
def goodbye(reason):
"""
Stop the process if stdin is closed.
"""
try:
reactor.stop()
except ReactorNotRunning:
pass
return origLost(reason)
示例2: clientConnectionFailed
# 需要導入模塊: from twisted.internet import error [as 別名]
# 或者: from twisted.internet.error import ReactorNotRunning [as 別名]
def clientConnectionFailed(self, connector, reason):
self.rx._callback('error', 'connection %s failed, reason=%s' % (connector, reason))
if reactor.running:
try:
reactor.stop()
except error.ReactorNotRunning:
pass
示例3: clientConnectionLost
# 需要導入模塊: from twisted.internet import error [as 別名]
# 或者: from twisted.internet.error import ReactorNotRunning [as 別名]
def clientConnectionLost(self, connector, reason):
self.rx._callback('error', 'connection %s lost, reason=%s' % (connector, reason))
if reactor.running:
try:
reactor.stop()
except error.ReactorNotRunning:
pass
示例4: stop
# 需要導入模塊: from twisted.internet import error [as 別名]
# 或者: from twisted.internet.error import ReactorNotRunning [as 別名]
def stop(self):
"""
See twisted.internet.interfaces.IReactorCore.stop.
"""
if self._stopped:
raise error.ReactorNotRunning(
"Can't stop reactor that isn't running.")
self._stopped = True
self._justStopped = True
self._startedBefore = True
示例5: stop
# 需要導入模塊: from twisted.internet import error [as 別名]
# 或者: from twisted.internet.error import ReactorNotRunning [as 別名]
def stop(self):
"""
Stop the reactor.
"""
if not self._running:
raise error.ReactorNotRunning()
self._running = False
示例6: postStartService
# 需要導入模塊: from twisted.internet import error [as 別名]
# 或者: from twisted.internet.error import ReactorNotRunning [as 別名]
def postStartService(self):
"""
Quit right away
"""
from twisted.internet import reactor
from twisted.internet.error import ReactorNotRunning
try:
reactor.stop()
except ReactorNotRunning:
# I don't care.
pass
示例7: fatal_error
# 需要導入模塊: from twisted.internet import error [as 別名]
# 或者: from twisted.internet.error import ReactorNotRunning [as 別名]
def fatal_error(stop_reactor=True):
global __system_failed
__system_failed = True
if stop_reactor:
try:
reactor.stop()
except ReactorNotRunning:
pass
示例8: stop
# 需要導入模塊: from twisted.internet import error [as 別名]
# 或者: from twisted.internet.error import ReactorNotRunning [as 別名]
def stop(self):
"""
See twisted.internet.interfaces.IReactorCore.stop.
"""
if self._stopped:
raise error.ReactorNotRunning(
"Can't stop reactor that isn't running.")
self._stopped = True
self._justStopped = True