def handle_result(self, idents, parent, raw_msg, success=True):
<EOL>engine = idents[<NUM_LIT:0>]<EOL>client = idents[<NUM_LIT:1>]<EOL>raw_msg[:<NUM_LIT:2>] = [client,engine]<EOL>self.client_stream.send_multipart(raw_msg, copy=False)<EOL>msg_id = parent['<STR_LIT>']<EOL>self.pending[engine].pop(msg_id)<EOL>if success:<EOL><INDENT>self.completed[engine].add(msg_id)<EOL>self.all_completed.add(msg_id)<EOL><DEDENT>else:<EOL><INDENT>self.failed[engine].add(msg_id)<EOL>self.all_failed.add(msg_id)<EOL><DEDENT>self.all_done.add(msg_id)<EOL>self.destinations[msg_id] = engine<EOL>self.update_graph(msg_id, success)<EOL>
handle a real task result, either success or failure