def worker_done_with_reply(self, reply, msgid, death, pid): """ Worker finished a job and requested the return value """ try: reply = serializer(reply) except TypeError as e: reply = serializer({"value": str(e)}) self.send_reply(reply, msgid) if self.status != STATUS.stopping and not death: self.send_ready()
def send_reply(self, res): """ Sends an REPLY response Args: socket (socket): The socket to use for this ack recipient (str): The recipient id for the ack msgid: The unique id that we are acknowledging """ msgid = res[0] reply = res[1] reply = serializer(reply) sendmsg(self.outgoing, 'REPLY', [reply, msgid])