def run(self, data_cb):
if self._error:<EOL><INDENT>err = self._error<EOL>if isinstance(self._error, KeyboardInterrupt):<EOL><INDENT>self._error = None<EOL><DEDENT>raise err<EOL><DEDENT>self._on_data = data_cb<EOL>if threading.current_thread() == main_thread:<EOL><INDENT>self._setup_signals([signal.SIGINT, signal.SIGTERM])<EOL><DEDENT>debug('<STR_LIT>')<EOL>self._run()<EOL>debug('<STR_LIT>')<EOL>if threading.current_thread() == main_thread:<EOL><INDENT>self._teardown_signals()<EOL>signal.signal(signal.SIGINT, default_int_handler)<EOL><DEDENT>self._on_data = None<EOL>
Run the event loop.