environment/lib/python2.7/site-packages/IPython/parallel/controller/scheduler.py
def dispatch_result(self, raw_msg):
        """dispatch method for result replies"""
        try:
            idents,msg = self.session.feed_identities(raw_msg, copy=False)
            msg = self.session.unserialize(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::Invaid result: %r", raw_msg, exc_info=True)
            return

        header = msg['header']
        parent = msg['parent_header']
        if header.get('dependencies_met', True):
            success = (header['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)
def dispatch_result(self, raw_msg):
        try:
            idents,msg = self.session.feed_identities(raw_msg, copy=False)
            msg = self.session.unserialize(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::Invaid result: %r", raw_msg, exc_info=True)
            return

        header = msg['header']
        parent = msg['parent_header']
        if header.get('dependencies_met', True):
            success = (header['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)
def dispatch_result ( self , raw_msg ) : try : idents , msg = self . session . feed_identities ( raw_msg , copy = False ) msg = self . session . unserialize ( 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::Invaid result: %r" , raw_msg , exc_info = True ) return header = msg [ 'header' ] parent = msg [ 'parent_header' ] if header . get ( 'dependencies_met' , True ) : success = ( header [ '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 )
dispatch method for result replies
dispatch method for result replies