def run_forever(self):
cnt = <NUM_LIT:0><EOL>while True:<EOL><INDENT>cnt += <NUM_LIT:1><EOL>self.url = next(self.urls)<EOL>log.debug("<STR_LIT>" % self.url)<EOL>try:<EOL><INDENT>self.ws = websocket.WebSocketApp(<EOL>self.url,<EOL>on_message=self.on_message,<EOL>on_error=self.on_error,<EOL>on_close=self.on_close,<EOL>on_open=self.on_open,<EOL>)<EOL>self.ws.run_forever()<EOL><DEDENT>except websocket.WebSocketException as exc:<EOL><INDENT>if self.num_retries >= <NUM_LIT:0> and cnt > self.num_retries:<EOL><INDENT>raise NumRetriesReached()<EOL><DEDENT>sleeptime = (cnt - <NUM_LIT:1>) * <NUM_LIT:2> if cnt < <NUM_LIT:10> else <NUM_LIT:10><EOL>if sleeptime:<EOL><INDENT>log.warning(<EOL>"<STR_LIT>"<EOL>% (self.url, cnt, self.num_retries)<EOL>+ "<STR_LIT>" % sleeptime<EOL>)<EOL>time.sleep(sleeptime)<EOL><DEDENT><DEDENT>except KeyboardInterrupt:<EOL><INDENT>self.ws.keep_running = False<EOL>raise<EOL><DEDENT>except Exception as e:<EOL><INDENT>log.critical("<STR_LIT>".format(str(e), traceback.format_exc()))<EOL><DEDENT><DEDENT>
This method is used to run the websocket app continuously.
            It will execute callbacks as defined and try to stay
            connected with the provided APIs