示例#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)