code: def stop(self):
          
          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")
docs: Stops the pusherclient cleanly