[Twisted-Python] xmlrpc deferred

Catalin Constantin catalin at dazoot.ro
Sat May 28 03:57:44 EDT 2005


thank you for your reply !

i've figured it out !

        def handleResult(self, ulist):
                return ulist
                
        def xmlrpc_getList(self, id):
                d = threads.deferToThread(self.feeder.get_urls, id)
                d.addCallback(self.handleResult)
                return d

it works !

very nice indeed :D

Friday, May 27, 2005, 11:11:47 PM, Jp Calderone wrote:
> If the database doesn't provide an async API, threads may be the
> only reasonable solution.  If the database adapter is a DB-API 2.0
> module, this is already available for you:
> twisted.enterprise.adbapi.  Otherwise, you may need to use the
> "low level" Twisted threading API,
> twisted.internet.threads.deferToThread(), or even
> reactor.callInThread() and
> reactor.callFromThread(), depending on your particular needs.


-- 
Catalin Constantin
Dazoot Software
http://www.dazoot.ro





More information about the Twisted-Python mailing list