class_docstr: Python TaskScheduler object.
  
  This is the simplest object that supports msg_id based
  DAG dependencies. *Only* task msg_ids are checked, not
  msg_ids of jobs submitted via the MUX queue.
class_docstr_tok: ["Python","TaskScheduler","object",".","This","is","the","simplest","object","that","supports","msg_id","based","DAG","dependencies",".","*","Only","*","task","msg_ids","are","checked",",","not","msg_ids","of","jobs","submitted","via","the","MUX","queue","."]
docstr: dispatch method for result replies
docstr_tok: ["dispatch","method","for","result","replies"]
code: def dispatch_result(self, raw_msg):  # maybe_dispatch_reults ?
      """dispatch method for result replies"""
      try:
          idents, msg = self.session.feed_identities(
              raw_msg, copy=False
          )
          msg = self.session.deserialize(msg, content=False, copy=False)
          engine = idents[0]
          try:
              idx = self.targets.index(engine)
          except ValueError:
              pass  # skip load-update for dead engines
          else:
              self.finish_job(idx)
      except Exception:
          self.log.error(
              "task::Invalid result: %r", raw_msg, exc_info=True
          )
          return
  
      md = msg["metadata"]
      parent = msg["parent_header"]
      if md.get("dependencies_met", True):
          success = md["status"] == "ok"
          msg_id = parent["msg_id"]
          retries = self.retries[msg_id]
          if not success and retries > 0:
              # failed
              self.retries[msg_id] = retries - 1
              self.handle_unmet_dependency(idents, parent)
          else:
              del self.retries[msg_id]
              # relay to client and update graph
              self.handle_result(idents, parent, raw_msg, success)
              # send to Hub monitor
              self.mon_stream.send_multipart(
                  [b"outtask"] + raw_msg, copy=False
              )
      else:
          self.handle_unmet_dependency(idents, parent)
  
imports: import time
  from collections import deque
  from random import randint, random
  from types import FunctionType
  import zmq
  from traitlets import Dict, Enum, Instance, Integer, List, observe
  from ipyparallel import Dependency, error, util
  from ipyparallel.controller.scheduler import Scheduler
label_desc: Use image node_id 17 for calling the TaskScheduler obj's underlying member method code with example usage: obj.dispatch_result(raw_msg) without return types