<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def stop(self):
 """Stops the pusherclient cleanly """

        self.pusherthread_stop.set()
        self.pusher.disconnect()

        # wait until pusher is down
        while self.pusher.connection.state is "connected":
            sleep(0.1)
        logging.info("shutting down pusher connector thread")