class_docstr: This is where tuners and assessors are not defined yet.
  Inherits this class to make your own advisor.
  
  .. note::
  
      The class inheriting MsgDispatcherBase should be instantiated
      after nnimanager (rest server) is started, so that the object
      is ready to use right after its instantiation.
class_docstr_tok: ["This","is","where","tuners","and","assessors","are","not","defined","yet",".","Inherits","this","class","to","make","your","own","advisor",".","..","note",":",":","The","class","inheriting","MsgDispatcherBase","should","be","instantiated","after","nnimanager","(","rest","server",")","is","started",",","so","that","the","object","is","ready","to","use","right","after","its","instantiation","."]
docstr: Run the tuner.
  This function will never return unless raise.
docstr_tok: ["Run","the","tuner",".","This","function","will","never","return","unless","raise","."]
code: def run(self):
      """Run the tuner.
      This function will never return unless raise.
      """
      _logger.info("Dispatcher started")
  
      self.default_worker.start()
      self.assessor_worker.start()
  
      if dispatcher_env_vars.NNI_MODE == "resume":
          self.load_checkpoint()
  
      while not self.stopping:
          command, data = self._channel._receive()
          if data:
              data = load(data)
  
          if command is None or command is CommandType.Terminate:
              break
          self.enqueue_command(command, data)
          if self.worker_exceptions:
              break
  
      _logger.info("Dispatcher exiting...")
      self.stopping = True
      self.default_worker.join()
      self.assessor_worker.join()
      self._channel.disconnect()
  
      _logger.info("Dispatcher terminiated")
  
imports: import threading
  import logging
  from queue import Queue, Empty
  from .env_vars import dispatcher_env_vars
  from ..common import load
  from ..recoverable import Recoverable
  from .tuner_command_channel import CommandType, TunerCommandChannel
label_desc: Use image node_id 2 for calling the MsgDispatcherBase obj's underlying member method code with example usage: obj.run() without return types