[Twisted-Python] Asynchronous context in Twisted
glyph at twistedmatrix.com
Thu Mar 3 14:39:37 EST 2011
On Mar 3, 2011, at 7:31 AM, Fantix King wrote:
> I tried to make python.context work in asynchronous code between main loops. Anyone has similar experience to share please?
> Not sure if I am rebuilding a wheel :P
This is something I've often thought about doing in Twisted itself, actually :). But I wasn't sure that chaining context would actually do anything practically useful most of the time. Have you found that it's actually useful? Have you managed to leverage this to, for example, get more informative error messages out of Deferred failures?
Doing it as a subclass like this is not optimal, as it limits you to one reactor (and the Select reactor is not really the best one). A wrapper would be slightly more tricky (you'd have to deal with the places that the reactor passes itself through to things like Process and Port, so you'd have to create wrappers for those as well) but much more general.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python