[Twisted-Python] Question about XMLRPC, Sync and ASync

Jason Valenzuela jvalenzuela1977 at gmail.com
Fri Aug 6 23:41:11 EDT 2010

On 8/7/2010 2:02 AM, Colin Fox wrote:

> I think that deferreds will play a part here, but I guess I must be
> missing something, as I'm not sure how to proceed. Can I return a
> deferred from my XMLRPC handler?

You may indeed return a deferred from an RPC method.

> And if so, how do I fire the callback
> when the result comes in to the LineReceiver?

Your remote method that returned the deferred must keep a reference of 
that deferred object until such time as the result is ready. You then 
call the deferred's callback method with the result as the argument.

On another note, if both of your servers are using twisted, a 
prospective broker interface may be easier than a low level LineReceiver 

Jason Valenzuela

More information about the Twisted-Python mailing list