def run(self):
if self._live:<EOL><INDENT>self._use_process = True<EOL><DEDENT>self._abort = False<EOL>campfire = self._room.get_campfire()<EOL>if self._live:<EOL><INDENT>process = LiveStreamProcess(campfire.get_connection().get_settings(), self._room.id)<EOL><DEDENT>else:<EOL><INDENT>process = StreamProcess(campfire.get_connection().get_settings(), self._room.id, pause=self._pause)<EOL><DEDENT>if not self._use_process:<EOL><INDENT>process.set_callback(self.incoming)<EOL><DEDENT>if self._use_process:<EOL><INDENT>queue = Queue()<EOL>process.set_queue(queue)<EOL>process.start()<EOL>if not process.is_alive():<EOL><INDENT>return<EOL><DEDENT><DEDENT>self._streaming = True<EOL>while not self._abort:<EOL><INDENT>if self._use_process:<EOL><INDENT>if not process.is_alive():<EOL><INDENT>self._abort = True<EOL>break<EOL><DEDENT>try:<EOL><INDENT>incoming = queue.get_nowait()<EOL>if isinstance(incoming, list):<EOL><INDENT>self.incoming(incoming)<EOL><DEDENT>elif isinstance(incoming, Exception):<EOL><INDENT>self._abort = True<EOL>if self._error_callback:<EOL><INDENT>self._error_callback(incoming, self._room)<EOL><DEDENT><DEDENT><DEDENT>except Empty:<EOL><INDENT>time.sleep(self._pause)<EOL>pass<EOL><DEDENT><DEDENT>else:<EOL><INDENT>process.fetch()<EOL>time.sleep(self._pause)<EOL><DEDENT><DEDENT>self._streaming = False<EOL>if self._use_process and self._abort and not process.is_alive() and self._error_callback:<EOL><INDENT>self._error_callback(Exception("<STR_LIT>"), self._room)<EOL><DEDENT>if self._use_process:<EOL><INDENT>queue.close()<EOL>if process.is_alive():<EOL><INDENT>process.stop()<EOL>process.terminate()<EOL><DEDENT>process.join()<EOL><DEDENT>
Called by the thread, it runs the process.

        NEVER call this method directly. Instead call start() to start the thread.

        To stop, call stop(), and then join()