Пример #1
0
	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)
Пример #2
0
	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)
Пример #3
0
    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)
Пример #4
0
    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)
Пример #5
0
    def callLater(self, _seconds, _f, *args, **kw):
        """
		Implement L{IReactorTime.callLater}.
		"""
        delayedCall = PosixReactorBase.callLater(self, _seconds, _f, *args,
                                                 **kw)
        self._scheduleSimulate()
        return delayedCall
Пример #6
0
	def callLater(self, _seconds, _f, *args, **kw):
		"""
		Implement L{IReactorTime.callLater}.
		"""
		delayedCall = PosixReactorBase.callLater(
			self, _seconds, _f, *args, **kw
		)
		self._scheduleSimulate()
		return delayedCall
Пример #7
0
	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
Пример #8
0
    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
Пример #9
0
	def stop(self):
		"""
		Implement L{IReactorCore.stop}.
		"""
		PosixReactorBase.stop(self)
		self._scheduleSimulate(True)
Пример #10
0
    def stop(self):
        """
		Implement L{IReactorCore.stop}.
		"""
        PosixReactorBase.stop(self)
        self._scheduleSimulate(True)