11 ms·
> I can. Twisted is viral (not in a good way always). Once you start using Twisted you are doomed and stuck in a parallel reality of Twisted-only libraries fore
by lvh 13y ago
> I can. Twisted is viral (not in a good way always). Once you start using Twisted you are doomed and stuck in a parallel reality of Twisted-only libraries forever. I have used Twisted professionally for 4+ years, this is not something I just read on a blog.
This seems to be a common sentiment. I'm writing a talk which I'm submitting to PyCon 2014 that hopes to demonstrate that that isn't (or doesn't have to be) true.
I've made the repo[1] and preliminary slides[2] available :)
[1]: https://github.com/lvh/TwistedMixing https://github.com/lvh/TwistedMixing
[2]: http://blog.lvh.io/TwistedMixing http://blog.lvh.io/TwistedMixing
- rdtsc 13y agoThat's a very good presentation. Thanks for sharing. Yes it is possible to use deferToThread and I like run_in_reactor trick. Very nice. eventlet by the way was integrated with a Twisted reactor as well. So it could co-operate with it. But, it was never a question of "impossible" it more of a question of it being "annoying".
- d0mine 13y agoThere seems to be a bug on "Deferred vs blocking API" slide: d = async_read() d.addCallbacks(on_result, on_failure) on_failure() is not called if on_result() raises an exception but it might be called in the blocking code: try: result = blocking_read() on_result(result) except SomeError as e: on_failure(e) The blocking analog of the addCallbacks() call could be: try: result = blocking_read() except SomeError as e: on_failure(e) else: on_result(result) # on_failure() is not called
- lvh 13y agoOops! Good catch :)