def run(self, once=False):
        """Runs the reactor in the main thread."""
        self._once = once
        self.start()
        while self.running:
            try:
                time.sleep(1.0)
            except KeyboardInterrupt:
                self.stop()
                self.join()
Runs the reactor in the main thread.