On 04/13/2016 10:57 PM, Glyph wrote:
One advantage of having this directly supported in Twisted, then, would be
calling no_setup() (or equivalent) early on in 'twistd' and equivalent tools,
so that crochet-using modules could be imported as part of a twisted-native
plugin?
That would be pretty cool, yes, although it doesn't strictly require
Crochet be part of Twisted.
It might also be able to have a slightly different API. For example, maybe
setup() or some analogue thereof could set up an 'atexit' hook that runs the
reactor if nobody gets around to calling run() before it exits?
Huh. Well... Crochet exits when main thread exits, so if atexit was
called that means there's no more threads. So that probably wouldn't work.
More broadly, Crochet is a pile of these sort of horrible hacks,
encapsulated in one place and hidden as much as possible. But there's
rough edges that poke out occasionally. I'm not sure Twisted ought to be
that kind of library.
_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python