def startReactor(self, reactor, oldstdout, oldstderr): """ Run the reactor with the given configuration. Subclasses should probably call this from C{postApplication}. @see: L{runReactorWithLogging} """ if reactor is None: from twisted.internet import reactor runReactorWithLogging(self.config, oldstdout, oldstderr, self.profiler, reactor) if _ISupportsExitSignalCapturing.providedBy(reactor): self._exitSignal = reactor._exitSignal else: self._exitSignal = None
def run(twistOptions: TwistOptions) -> None: """ Run the application service. @param twistOptions: Command line options to convert to runner arguments. """ runner = Runner( reactor=twistOptions["reactor"], defaultLogLevel=twistOptions["logLevel"], logFile=twistOptions["logFile"], fileLogObserverFactory=twistOptions["fileLogObserverFactory"], ) runner.run() reactor = twistOptions["reactor"] if _ISupportsExitSignalCapturing.providedBy(reactor): if reactor._exitSignal is not None: _exitWithSignal(reactor._exitSignal)