TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The Twisted Way

27 pointsby pablohoffmanover 12 years ago

8 comments

vosperover 12 years ago
Twisted is the least accessible of the big Python libraries that I've come across. I've come to it a couple of times when it seemed like it would suit a problem I had, only to throw up my hands in frustration and go look for a solution somewhere else.<p>Unfortunately this article did nothing to enlighten me - it has some pretensions of being philosophical without explaining any of the practicalities.<p>Does anyone use Twisted in production? Do you consider it worth the learning curve, and would you use it again if you were implementing your system now?
评论 #4976917 未加载
评论 #4976685 未加载
评论 #4977149 未加载
评论 #4976688 未加载
评论 #4977150 未加载
pekkover 12 years ago
It's a library, not the Tao. And it is a big, complex library which introduces plenty of its own unique jargon and abstractions, which is why people find it confusing.<p>The fact that Twisted advocates have to keep browbeating others to accept it is just one indication that it's not perfect and it's not for everyone.
rhettgover 12 years ago
I've used twisted for semi-major project (<a href="https://github.com/Yelp/Tron" rel="nofollow">https://github.com/Yelp/Tron</a>).<p>It's certainly a difficult thing to get your head around. The parts of the project that touch twisted is always the most complex to explain to anyone else. However, async code is always hard. It also doesn't help that the code base shows it's age.. non-PEP8, strange naming conventions etc.<p>However, one thing that I've noticed with recent projects using Tornado (<a href="https://github.com/rhettg/Dynochemy" rel="nofollow">https://github.com/rhettg/Dynochemy</a>) is that some concepts that I thought was overly complex in Twisted makes sense eventually. For example, handling errors in async code is really hard. The framework twisted came up with with Deferred, callbacks and errbacks is pretty smart. You almost have to re-invent twisted before you can appreciate it.<p>I'd recommend reading the original paper for more information: <a href="http://www6.uniovi.es/python/pycon/papers/deferex/" rel="nofollow">http://www6.uniovi.es/python/pycon/papers/deferex/</a>
ishbitsover 12 years ago
I used Twisted in 2005 to develop and server and agent infrastructure.. Portions of the system are now in Java, but the distributed agents are still in Python and out there in production..<p>I am currently not using Twisted for anything, but often think that things I'm currently working on would be easier if done in Twisted.<p>I came to Twisted after 5 years of doing non-blocking servers in C with libevent (or hand rolled event loops). So I didn't have to wrap my head around don't call us, we'll call you aspect. I'm currently using Tornado for a websocket based service, but will probably use Twisted again for my next Python project.
inglespover 12 years ago
For anybody wanting to learn Twisted, I can only really recommend the excellent introduction to asynchronous programming (with Twisted) here: <a href="http://krondo.com/?page_id=1327" rel="nofollow">http://krondo.com/?page_id=1327</a>
sneakover 12 years ago
Twisted is great. The only real problem comes from their utter unwillingness to accept less-than-100%-perfect ipv6 patches. It's 2012 for fuck's sake.
leoliuover 12 years ago
I am more interested in a post about what's wrong with twisted. Anyone care to comment?
评论 #4977495 未加载
cmccabeover 12 years ago
GREAT SOLUTIONS IN ENGINEERING<p>Problem: bicycle seats are <i>hard.</i> They hurt.<p>Analysis: there must be something wrong with your pants.<p>"Solution": dorky pants.<p>from <a href="http://dilbert.com/strips/comic/1994-07-18/" rel="nofollow">http://dilbert.com/strips/comic/1994-07-18/</a><p>Problem: Python has poor support for threads, and concurrency in general.<p>Analysis: you must need more middleware.<p>"Solution": incomprehensible callback-based frameworks.
评论 #4976988 未加载