<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _runForever(self, stop_event):
 """Runs the main loop Arguments: stop_event: threading.Event() as a stop signal """

        while(not stop_event.is_set()):
            state = self.pusher.connection.state

            if (state is not "connecting" and
                    state is not "connected"):
                self.logger.warning(
                    "Pusher seems to be disconnected, trying to reconnect")
                self.pusher.connect()

            stop_event.wait(0.5)