def crash(self): """ Implement L{IReactorCore.crash} """ wasStarted = self._started PosixReactorBase.crash(self) if self._inCFLoop: self._stopNow() else: if wasStarted: self.callLater(0, self._stopNow)
def __init__(self, runLoop=None, runner=None): self._fdmap = {} self._idmap = {} if runner is None: runner = CFRunLoopRun self._runner = runner if runLoop is None: runLoop = CFRunLoopGetMain() self._cfrunloop = runLoop PosixReactorBase.__init__(self)
def callLater(self, _seconds, _f, *args, **kw): """ Implement L{IReactorTime.callLater}. """ delayedCall = PosixReactorBase.callLater(self, _seconds, _f, *args, **kw) self._scheduleSimulate() return delayedCall
def callLater(self, _seconds, _f, *args, **kw): """ Implement L{IReactorTime.callLater}. """ delayedCall = PosixReactorBase.callLater( self, _seconds, _f, *args, **kw ) self._scheduleSimulate() return delayedCall
def _moveCallLaterSooner(self, tple): """ Override L{PosixReactorBase}'s implementation of L{IDelayedCall.reset} so that it will immediately reschedule. Normally C{_moveCallLaterSooner} depends on the fact that C{runUntilCurrent} is always run before the mainloop goes back to sleep, so this forces it to immediately recompute how long the loop needs to stay asleep. """ result = PosixReactorBase._moveCallLaterSooner(self, tple) self._scheduleSimulate() return result
def stop(self): """ Implement L{IReactorCore.stop}. """ PosixReactorBase.stop(self) self._scheduleSimulate(True)