[Twisted-Python] Crochet 1.5.0: Use Twisted in Django, Flask, or anywhere else

Itamar Turner-Trauring itamar at itamarst.org
Thu Apr 14 06:45:58 MDT 2016


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.





More information about the Twisted-Python mailing list