code: def eval_command(self, cmd):
          
          if cmd == 'restart':
              self.restart(soft=True)
          elif cmd == 'stop':
              self.stop()
docs: Thread func to allow restarting / stopping of threads, for example
          when receiving a connection reset info message from the wss server.
          :return: