On Mar 3, 2011, at 7:31 AM, Fantix King wrote:

> Hi,
> 
> 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
> 
> http://code.google.com/p/little-site/source/browse/littlesite/custom_reactor.py

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.

_______________________________________________
Twisted-Python mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to