[Twisted-Python] xmlrpc deferred

Itamar Shtull-Trauring itamar at itamarst.org
Fri May 27 15:47:11 EDT 2005


On Fri, 2005-05-27 at 22:28 +0300, Catalin Constantin wrote:

> The thing is that the self.feeder.get_urls takes too long to execute
> and while the request is running all the others are blocked.
> I want that while it computes the result the other XML RPC methods to
> be available.
> 
> I wanted to use deferrals but i found no viable example.

Deferreds do not magically make a calculation not block. Once you have
made your calculation not block ("take a long time"), e.g. by splitting
it up into small processing chunks separated by reactor.callLater(0,),
Deferreds provide a way to easily get the "result" of a non-blocking
function.





More information about the Twisted-Python mailing list