[Twisted-Python] deferred object inside function

Yusnel Rojas García yrojass at gmail.com
Fri Jul 7 03:10:20 EDT 2006

how can I make a function which have a deferred object return a value that
depends of the deferred object's result.
how can get the result from the resolver?

from twisted.names import client, dns

def somefunction(somepars):
       r  = client.Resolver('/etc/resolv.conf')
       d = r.resolve(dns.Query('www.example.com', dns.MX, dns.IN))
       d.Callbacks(somefunct1, somefunctErr2)
       return ?

cheers one
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20060707/44a85ee0/attachment.htm 

More information about the Twisted-Python mailing list