[Twisted-Python] xmlrpc and deferred result doubts

Hi All
I have a doubt about how to factor the an xmlrpc server code. Basicly what happens is:
def xmlrpc_runCmd(self, hostname, command): # I call a method that returns a deferred and because of that I # don't have anything to return to the xmlrpc client. runComm = conn.runCommand(hostname, command) # the line below doesn't make much sense because the output needs to # return to the xmlrpc client runComm.addCallback(self.printOutput)
return ???? # return what?!?!?!?
What should I do? How should I factor the code?
Thanks Gustavo

On Sun, 05 Feb 2006 19:09:06 -0200, Gustavo Rahal gustavo@grahal.net wrote:
Hi All
I have a doubt about how to factor the an xmlrpc server code. Basicly what happens is:
def xmlrpc_runCmd(self, hostname, command): # I call a method that returns a deferred and because of that I # don't have anything to return to the xmlrpc client. runComm = conn.runCommand(hostname, command) # the line below doesn't make much sense because the output needs to # return to the xmlrpc client runComm.addCallback(self.printOutput)
Return runComm instead. Also, mailto:twisted-web@twistedmatrix.com for web questions.
Jean-Paul
participants (2)
-
Gustavo Rahal
-
Jean-Paul Calderone