code: def __command_queue_listener(self):
          
          self.log.debug("Queue listener thread started")
          counter = itertools.count()  # insertion sequence to keep messages in order
          while not self.__shutdown:
              if self.__pipe_commands.poll(1):
                  try:
                      message = self.__pipe_commands.recv()
                  except EOFError:
                      # Pipe was closed by frontend. Shut down service.
                      self.__shutdown = True
                      self.log.error(
                          "Pipe closed by frontend, shutting down service", exc_info=True
                      )
                      break
                  queue_item = (Priority.COMMAND, next(counter), message)
                  try:
                      self.__queue.put(queue_item, True, 60)
                  except queue.Full:
                      # If the message can't be stored within 60 seconds then the service is
                      # operating outside normal parameters. Try to shut it down.
                      self.__shutdown = True
                      self.log.error(
                          "Write to service priority queue failed, shutting down service",
                          exc_info=True,
                      )
                      break
          self.log.debug("Queue listener thread terminating")
docs: Function to continuously retrieve data from the frontend. Commands are
          sent to the central priority queue. If the pipe from the frontend is
          closed the service shutdown is initiated. Check every second if service
          has shut down, then terminate.
          This function is run by a separate daemon thread, which is started by
          the __start_command_queue_listener function.