[Twisted-Python] deferred object inside function

Thomas Jacob jacob at internet24.de
Fri Jul 7 02:44:37 MDT 2006


Do you want to do something like the following?

http://twistedmatrix.com/projects/core/documentation/howto/deferredindepth.html#auto12


On Fri, 2006-07-07 at 00:10 -0700, Yusnel Rojas GarcĂ­a wrote:
> how can I make a function which have a deferred object return a value
> that depends of the deferred object's result.
> example:
> 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
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
URL: </pipermail/twisted-python/attachments/20060707/607eb2a7/attachment.sig>


More information about the Twisted-Python mailing list