[Twisted-Python] xmlrpc deferred
Catalin Constantin
catalin at dazoot.ro
Fri May 27 13:28:06 MDT 2005
Hi there,
I have the following xmlrpc method:
class FeederResource(xmlrpc.XMLRPC):
def __init__(self):
xmlrpc.XMLRPC.__init__(self)
self.feeder=Feeder()
def xmlrpc_getList(self, id):
return self.feeder.get_urls(id)
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.
Eg what i've tried to do:
def xmlrpc_getList(self, id):
log.debug("getList is here for id %s" % id)
d = defer.Deferred()
d.addCallback(self.feeder.get_urls)
return d
My method feeder.get_urls is never called !
Where do i do wrong !
10x for your help !
--
Catalin Constantin
Dazoot Software
http://www.dazoot.ro
More information about the Twisted-Python
mailing list