def __init__(self, document): """ :param document: The received document. :type document: Document """ AsyncReply.__init__(self, document) reply = Return(document.result) self.exval = RemoteException.instance(reply) self.xmodule = reply.xmodule, self.xclass = reply.xclass self.xstate = reply.xstate self.xargs = reply.xargs
def __init__(self, envelope): """ @param envelope: The received envelope. @type envelope: L{Envelope} """ AsyncReply.__init__(self, envelope) reply = Return(envelope.result) self.exval = RemoteException.instance(reply) self.xmodule = reply.xmodule, self.xclass = reply.xclass self.xstate = reply.xstate self.xargs = reply.xargs
def on_reply(self, document): """ Handle the reply. :param document: The reply document. :type document: Document :return: The matched reply document. :rtype: Document """ reply = Return(document.result) if reply.succeeded(): return reply.retval else: raise RemoteException.instance(reply)