TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The Twisted Way

27 点作者 pablohoffman超过 12 年前

8 条评论

vosper超过 12 年前
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 未加载
pekk超过 12 年前
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.
rhettg超过 12 年前
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>
ishbits超过 12 年前
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.
inglesp超过 12 年前
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>
sneak超过 12 年前
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.
leoliu超过 12 年前
I am more interested in a post about what's wrong with twisted. Anyone care to comment?
评论 #4977495 未加载
cmccabe超过 12 年前
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 未加载