<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/1.5.1.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: async_limits.py</title>
	<link>http://laurentszyster.be/blog/async_limits/</link>
	<description>Python on Peers</description>
	<pubDate>Fri, 10 Sep 2010 00:18:54 +0000</pubDate>
	<generator>http://wordpress.org/?v=1.5.1.3</generator>

	<item>
		<title>by: Laurent Szyster</title>
		<link>http://laurentszyster.be/blog/async_limits/#comment-797</link>
		<pubDate>Mon, 29 May 2006 07:36:13 +0000</pubDate>
		<guid>http://laurentszyster.be/blog/async_limits/#comment-797</guid>
					<description>There is now an article (and feed) to continue the general argument about Twisted vs. Allegra:

http://laurentszyster.be/blog/to-glyph/

Please restrict your comments here to async_limits.

Thanks,</description>
		<content:encoded><![CDATA[	<p>There is now an article (and feed) to continue the general argument about Twisted vs. Allegra:</p>
	<p><a href='http://laurentszyster.be/blog/to-glyph/' rel='nofollow'>http://laurentszyster.be/blog/to-glyph/</a></p>
	<p>Please restrict your comments here to async_limits.</p>
	<p>Thanks,
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Glyph Lefkowitz</title>
		<link>http://laurentszyster.be/blog/async_limits/#comment-792</link>
		<pubDate>Sun, 28 May 2006 02:37:38 +0000</pubDate>
		<guid>http://laurentszyster.be/blog/async_limits/#comment-792</guid>
					<description>&amp;#62;What is inacurate?

As I said in my first comment, your claims are technically correct (there are no &quot;readable&quot; or &quot;writable&quot; methods in Twisted to &quot;decorate&quot;), but they do not suggest an accurate conclusion: that Twisted makes it more difficult to throttle I/O.

If you had been seriously interested in criticizing Twisted rather than just maligning it, you would have posted a comparison of code complexity rather than saying &quot;here is how you do it in Allegra, I guess maybe it is worse in Twisted&quot;.  For example, here is an example of why an echo server in Asyncore is 4x as complicated as in Twisted:

http://twistedmatrix.com/products/echo_server

&amp;#62;For instance, can you tell how to *add* brakes to a connected stream transport with a protocol allready engaged in Twisted?

Unfortunately the documentation is rather thin on this since it's a backwards way to want to do things; you generally know about your limits before the protocol starts up, and then you forget about them while you're speaking it.  However, ignoring the obvious method-forwarding solution, there is always:

transport.protocol = throttler(transport.protocol)

Up front (using appropriately documented APIs), it's

listenXXX(factoryThrottler(factory))

I'm sorry, but I don't see how to make it less than one line of code.

&amp;#62;To conclude, here is my challenge: if I can convince the Python BDFL to include my changes and additions to asyncore and asynchat API into the Standard Python Library, would you consider abandonning Twisted?

Inclusion in the stdlib is a totally arbitrary standard.  For example, modules like &quot;Cookie&quot;, http://docs.python.org/lib/module-Cookie.html are included, which have not only asyncore's numerous design problems but also remote arbitrary code execution attacks in code _intended_ for use on networks.  That's to say nothing of rexec and Bastion.

If anything, based on what's already there, I would be even *more* convinced your code is terrible.

I have a huge amount of respect for Guido, and Python is still my favorite language, but that doesn't mean I don't think he ever makes mistakes.

&amp;#62; I doubt a tutorial about Twisted will change my view on its sources.

Why?  Every time you make a claim about it, some basic information (like &quot;here is how you activate a throttler&quot;) seems to prove you wrong.  It would seem very likely to me that if you understood it accurately your claims would change.</description>
		<content:encoded><![CDATA[	<p>&gt;What is inacurate?</p>
	<p>As I said in my first comment, your claims are technically correct (there are no &#8220;readable&#8221; or &#8220;writable&#8221; methods in Twisted to &#8220;decorate&#8221;), but they do not suggest an accurate conclusion: that Twisted makes it more difficult to throttle I/O.</p>
	<p>If you had been seriously interested in criticizing Twisted rather than just maligning it, you would have posted a comparison of code complexity rather than saying &#8220;here is how you do it in Allegra, I guess maybe it is worse in Twisted&#8221;.  For example, here is an example of why an echo server in Asyncore is 4x as complicated as in Twisted:</p>
	<p><a href='http://twistedmatrix.com/products/echo_server' rel='nofollow'>http://twistedmatrix.com/products/echo_server</a></p>
	<p>&gt;For instance, can you tell how to *add* brakes to a connected stream transport with a protocol allready engaged in Twisted?</p>
	<p>Unfortunately the documentation is rather thin on this since it&#8217;s a backwards way to want to do things; you generally know about your limits before the protocol starts up, and then you forget about them while you&#8217;re speaking it.  However, ignoring the obvious method-forwarding solution, there is always:</p>
	<p>transport.protocol = throttler(transport.protocol)</p>
	<p>Up front (using appropriately documented APIs), it&#8217;s</p>
	<p>listenXXX(factoryThrottler(factory))</p>
	<p>I&#8217;m sorry, but I don&#8217;t see how to make it less than one line of code.</p>
	<p>&gt;To conclude, here is my challenge: if I can convince the Python BDFL to include my changes and additions to asyncore and asynchat API into the Standard Python Library, would you consider abandonning Twisted?</p>
	<p>Inclusion in the stdlib is a totally arbitrary standard.  For example, modules like &#8220;Cookie&#8221;, <a href='http://docs.python.org/lib/module-Cookie.html' rel='nofollow'>http://docs.python.org/lib/module-Cookie.html</a> are included, which have not only asyncore&#8217;s numerous design problems but also remote arbitrary code execution attacks in code _intended_ for use on networks.  That&#8217;s to say nothing of rexec and Bastion.</p>
	<p>If anything, based on what&#8217;s already there, I would be even *more* convinced your code is terrible.</p>
	<p>I have a huge amount of respect for Guido, and Python is still my favorite language, but that doesn&#8217;t mean I don&#8217;t think he ever makes mistakes.</p>
	<p>&gt; I doubt a tutorial about Twisted will change my view on its sources.</p>
	<p>Why?  Every time you make a claim about it, some basic information (like &#8220;here is how you activate a throttler&#8221;) seems to prove you wrong.  It would seem very likely to me that if you understood it accurately your claims would change.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Laurent Szyster</title>
		<link>http://laurentszyster.be/blog/async_limits/#comment-780</link>
		<pubDate>Fri, 26 May 2006 13:57:04 +0000</pubDate>
		<guid>http://laurentszyster.be/blog/async_limits/#comment-780</guid>
					<description>&amp;#62;Can you please stop posting inaccurate claims about Twisted?

What is inacurate?

I never said there are no ways to produce the same effect (metering, timeout, throttling, etc) with Twisted &quot;fab four&quot; stop&amp;#166;start&amp;#166;Reading&amp;#166;Writing.

What I claim is that it is simpler to implement complex limits when the readable/writable IOC is available. 

For instance, can you tell how to *add* brakes to a connected stream transport with a protocol allready engaged in Twisted?

&amp;#62;It is getting tiring to watch all your enthusiasm go to waste on this dead end simply because you don’t seem to understand where Twisted provides the various features you are re-implementing. 

Well, the fact that it is so difficult to understand how Twisted works is part of the problem. 

The design of asyncore's loop is a bit more complex (there is one more IOC) but practically far much simpler to understand for application programmers: reading a single module source is enough.

Until Twisted core can be factored out in a single module and is included in the Standard Python Library, to label asyncore.py a &quot;dead-end&quot; will be inaccurate. Don't waste your time trying to convince me. Instead try to convince the Python library custodians to replace the existing module for asynchronous I/O. If you can. 

&amp;#62;Would it be useful to you if I were to provide you with a free Twisted tutoring session? All that I ask in exchange for my time is that you seriously consider abandoning Allegra’s medusa substrate, if I can demonstrate that Twisted is in fact adequate to your needs. 

Thanks for the offer, but I doubt a tutorial about Twisted will change my view on its sources. 

To conclude, here is my challenge: if I can convince the Python BDFL to include my changes and additions to asyncore and asynchat API into the Standard Python Library, would you consider abandonning Twisted?

Regards,</description>
		<content:encoded><![CDATA[	<p>&gt;Can you please stop posting inaccurate claims about Twisted?</p>
	<p>What is inacurate?</p>
	<p>I never said there are no ways to produce the same effect (metering, timeout, throttling, etc) with Twisted &#8220;fab four&#8221; stop|start|Reading|Writing.</p>
	<p>What I claim is that it is simpler to implement complex limits when the readable/writable IOC is available. </p>
	<p>For instance, can you tell how to *add* brakes to a connected stream transport with a protocol allready engaged in Twisted?</p>
	<p>&gt;It is getting tiring to watch all your enthusiasm go to waste on this dead end simply because you don’t seem to understand where Twisted provides the various features you are re-implementing. </p>
	<p>Well, the fact that it is so difficult to understand how Twisted works is part of the problem. </p>
	<p>The design of asyncore&#8217;s loop is a bit more complex (there is one more IOC) but practically far much simpler to understand for application programmers: reading a single module source is enough.</p>
	<p>Until Twisted core can be factored out in a single module and is included in the Standard Python Library, to label asyncore.py a &#8220;dead-end&#8221; will be inaccurate. Don&#8217;t waste your time trying to convince me. Instead try to convince the Python library custodians to replace the existing module for asynchronous I/O. If you can. </p>
	<p>&gt;Would it be useful to you if I were to provide you with a free Twisted tutoring session? All that I ask in exchange for my time is that you seriously consider abandoning Allegra’s medusa substrate, if I can demonstrate that Twisted is in fact adequate to your needs. </p>
	<p>Thanks for the offer, but I doubt a tutorial about Twisted will change my view on its sources. </p>
	<p>To conclude, here is my challenge: if I can convince the Python BDFL to include my changes and additions to asyncore and asynchat API into the Standard Python Library, would you consider abandonning Twisted?</p>
	<p>Regards,
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Mark P</title>
		<link>http://laurentszyster.be/blog/async_limits/#comment-775</link>
		<pubDate>Wed, 24 May 2006 19:09:03 +0000</pubDate>
		<guid>http://laurentszyster.be/blog/async_limits/#comment-775</guid>
					<description>I've watched the banter between the two chief protagonists here (glyph and the author), and while
it's quite amusing, it's also a little sad.

No doubt both are fine developers ... and I gotta believe that there's room for billions and billions
more lines of Python code in this world.  And there's room in Python for Twisted and Allegra too.

I've only glanced at Twisted ... looked at the examples.   Looks like deep black magic to me.
And that's seriously impressive, 'cause I'm sure that once you can craft spells in it, it will be very
powerful mojo.   But alas, I am a simple programmer.   I have real trouble getting my head around
very abstract stuff.   I really find the Medusa/Asyncore way quite easy.   But then I'm and old 
programmer and I've spent a lot of time doing sockets programming in &quot;C&quot; .... so this way is much
closer to the select/poll loop that I feel comfortable with.

Point is though, there are far smarter people around who would find the abstractions in Twisted
more natural.   And that's great for them.

So, keep up the good work in both projects.   We'll ALL be the better for it.</description>
		<content:encoded><![CDATA[	<p>I&#8217;ve watched the banter between the two chief protagonists here (glyph and the author), and while<br />
it&#8217;s quite amusing, it&#8217;s also a little sad.</p>
	<p>No doubt both are fine developers &#8230; and I gotta believe that there&#8217;s room for billions and billions<br />
more lines of Python code in this world.  And there&#8217;s room in Python for Twisted and Allegra too.</p>
	<p>I&#8217;ve only glanced at Twisted &#8230; looked at the examples.   Looks like deep black magic to me.<br />
And that&#8217;s seriously impressive, &#8217;cause I&#8217;m sure that once you can craft spells in it, it will be very<br />
powerful mojo.   But alas, I am a simple programmer.   I have real trouble getting my head around<br />
very abstract stuff.   I really find the Medusa/Asyncore way quite easy.   But then I&#8217;m and old<br />
programmer and I&#8217;ve spent a lot of time doing sockets programming in &#8220;C&#8221; &#8230;. so this way is much<br />
closer to the select/poll loop that I feel comfortable with.</p>
	<p>Point is though, there are far smarter people around who would find the abstractions in Twisted<br />
more natural.   And that&#8217;s great for them.</p>
	<p>So, keep up the good work in both projects.   We&#8217;ll ALL be the better for it.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Sylvain</title>
		<link>http://laurentszyster.be/blog/async_limits/#comment-773</link>
		<pubDate>Wed, 24 May 2006 06:38:37 +0000</pubDate>
		<guid>http://laurentszyster.be/blog/async_limits/#comment-773</guid>
					<description>I've been following threads on this blog for a while but I admit most of the time Laurent lost me completely in the manner he explains Allegra. I would not have a clue if it can be good or not.

But for the last couple of days, I've also noted that several people from Twisted have come and explain extensively that Laurent was wrong on so many points that I start doubting of the quality behind his code.

I've been also put off by Laurent complete misunderstanding of inheritance vs. composition.

Laurent, you should seriously consider doing something more positive with your energy because you are getting nowehere I'm afraid.</description>
		<content:encoded><![CDATA[	<p>I&#8217;ve been following threads on this blog for a while but I admit most of the time Laurent lost me completely in the manner he explains Allegra. I would not have a clue if it can be good or not.</p>
	<p>But for the last couple of days, I&#8217;ve also noted that several people from Twisted have come and explain extensively that Laurent was wrong on so many points that I start doubting of the quality behind his code.</p>
	<p>I&#8217;ve been also put off by Laurent complete misunderstanding of inheritance vs. composition.</p>
	<p>Laurent, you should seriously consider doing something more positive with your energy because you are getting nowehere I&#8217;m afraid.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Andrew</title>
		<link>http://laurentszyster.be/blog/async_limits/#comment-771</link>
		<pubDate>Wed, 24 May 2006 05:40:04 +0000</pubDate>
		<guid>http://laurentszyster.be/blog/async_limits/#comment-771</guid>
					<description>Twisted has reusable throttlers in twisted.protocols.policies.  I'm not sure exactly what you are claiming is impossible, as you have noticed many times that by design Twisted does not have the equivalent of your 'readable' and 'writable' methods.  Anyway, the existence of twisted.protocols.policies ought to be adequate proof that it *is* possible to do throttling with Twisted independently of any particular protocol or transport.

(Although it's often simpler to use an existing utility like trickle(1) than to write code.)</description>
		<content:encoded><![CDATA[	<p>Twisted has reusable throttlers in twisted.protocols.policies.  I&#8217;m not sure exactly what you are claiming is impossible, as you have noticed many times that by design Twisted does not have the equivalent of your &#8216;readable&#8217; and &#8216;writable&#8217; methods.  Anyway, the existence of twisted.protocols.policies ought to be adequate proof that it *is* possible to do throttling with Twisted independently of any particular protocol or transport.</p>
	<p>(Although it&#8217;s often simpler to use an existing utility like trickle(1) than to write code.)
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Glyph Lefkowitz</title>
		<link>http://laurentszyster.be/blog/async_limits/#comment-768</link>
		<pubDate>Wed, 24 May 2006 03:41:29 +0000</pubDate>
		<guid>http://laurentszyster.be/blog/async_limits/#comment-768</guid>
					<description>&amp;#62; To decorate readable or writable with reusable throttlers is impossible in the Twisted framework.

Technically you are correct because Twisted does not have the redundant, inefficient 'readable' and 'writable' methods.  However, bandwidth throttling is not only possible, it is implemented (twice) within Twisted itself:

http://twistedmatrix.com/trac/browser/trunk/twisted/protocols/policies.py?rev=16922#L158

and

http://twistedmatrix.com/trac/browser/trunk/twisted/protocols/htb.py?rev=16922#L228

By wrapping transports, producers, and consumers, you can easily implement your own traffic-shaping algorithms as well, and wrap them around any Twisted protocol implementation, on either the send or receive side.

Can you please stop posting inaccurate claims about Twisted?

It is getting tiring to watch all your enthusiasm go to waste on this dead end simply because you don't seem to understand where Twisted provides the various features you are re-implementing.  Would it be useful to you if I were to provide you with a free Twisted tutoring session?  All that I ask in exchange for my time is that you seriously consider abandoning Allegra's medusa substrate, if I can demonstrate that Twisted is in fact adequate to your needs.</description>
		<content:encoded><![CDATA[	<p>&gt; To decorate readable or writable with reusable throttlers is impossible in the Twisted framework.</p>
	<p>Technically you are correct because Twisted does not have the redundant, inefficient &#8216;readable&#8217; and &#8216;writable&#8217; methods.  However, bandwidth throttling is not only possible, it is implemented (twice) within Twisted itself:</p>
	<p><a href='http://twistedmatrix.com/trac/browser/trunk/twisted/protocols/policies.py?rev=16922#L158' rel='nofollow'>http://twistedmatrix.com/trac/browser/trunk/twisted/protocols/policies.py?rev=16922#L158</a></p>
	<p>and</p>
	<p><a href='http://twistedmatrix.com/trac/browser/trunk/twisted/protocols/htb.py?rev=16922#L228' rel='nofollow'>http://twistedmatrix.com/trac/browser/trunk/twisted/protocols/htb.py?rev=16922#L228</a></p>
	<p>By wrapping transports, producers, and consumers, you can easily implement your own traffic-shaping algorithms as well, and wrap them around any Twisted protocol implementation, on either the send or receive side.</p>
	<p>Can you please stop posting inaccurate claims about Twisted?</p>
	<p>It is getting tiring to watch all your enthusiasm go to waste on this dead end simply because you don&#8217;t seem to understand where Twisted provides the various features you are re-implementing.  Would it be useful to you if I were to provide you with a free Twisted tutoring session?  All that I ask in exchange for my time is that you seriously consider abandoning Allegra&#8217;s medusa substrate, if I can demonstrate that Twisted is in fact adequate to your needs.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
