<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for krondo</title>
	<atom:link href="http://krondo.com/?feed=comments-rss2" rel="self" type="application/rss+xml" />
	<link>http://krondo.com</link>
	<description>The website of Dave Peticolas</description>
	<lastBuildDate>Thu, 10 May 2012 14:36:37 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>Comment on An Introduction to Asynchronous Programming and Twisted by dave</title>
		<link>http://krondo.com/?p=1209&#038;cpage=1#comment-8538</link>
		<dc:creator>dave</dc:creator>
		<pubDate>Thu, 10 May 2012 14:36:37 +0000</pubDate>
		<guid isPermaLink="false">http://dpeticol.webfactional.com/blog/?p=1209#comment-8538</guid>
		<description>Hello, glad you liked the tutorial. All the later examples that use asynchronous programming have to deal with their input in small bits as they come in (the examples use artificially slow servers to illustrate the concepts).</description>
		<content:encoded><![CDATA[<p>Hello, glad you liked the tutorial. All the later examples that use asynchronous programming have to deal with their input in small bits as they come in (the examples use artificially slow servers to illustrate the concepts).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on An Introduction to Asynchronous Programming and Twisted by Brut</title>
		<link>http://krondo.com/?p=1209&#038;cpage=1#comment-8527</link>
		<dc:creator>Brut</dc:creator>
		<pubDate>Wed, 09 May 2012 20:34:46 +0000</pubDate>
		<guid isPermaLink="false">http://dpeticol.webfactional.com/blog/?p=1209#comment-8527</guid>
		<description>Hi Dave, Great Tut!

&quot;&quot;&quot;
The programmer must organize each task as a sequence of smaller steps that execute intermittently. And if one task uses the output of another, the dependent task must be written to accept its input as a series of bits and pieces instead of all together. 
&quot;&quot;&quot;

any examples for this concept in your tutorial?

Thanks!</description>
		<content:encoded><![CDATA[<p>Hi Dave, Great Tut!</p>
<p>&#8220;&#8221;"<br />
The programmer must organize each task as a sequence of smaller steps that execute intermittently. And if one task uses the output of another, the dependent task must be written to accept its input as a series of bits and pieces instead of all together.<br />
&#8220;&#8221;"</p>
<p>any examples for this concept in your tutorial?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on An Introduction to Asynchronous Programming and Twisted by dave</title>
		<link>http://krondo.com/?p=1445&#038;cpage=1#comment-8483</link>
		<dc:creator>dave</dc:creator>
		<pubDate>Mon, 07 May 2012 14:15:03 +0000</pubDate>
		<guid isPermaLink="false">http://krondo.com/blog/?p=1445#comment-8483</guid>
		<description>Hey James, looks good to me!</description>
		<content:encoded><![CDATA[<p>Hey James, looks good to me!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on An Introduction to Asynchronous Programming and Twisted by James</title>
		<link>http://krondo.com/?p=1445&#038;cpage=1#comment-8480</link>
		<dc:creator>James</dc:creator>
		<pubDate>Mon, 07 May 2012 08:26:41 +0000</pubDate>
		<guid isPermaLink="false">http://krondo.com/blog/?p=1445#comment-8480</guid>
		<description>Thanks for the great tutorials. I&#039;m really learning a lot!

For exercise 1, I modified &#039;init&#039; as follows:

    def __init__(self, task_num, address):
        self.task_num = task_num
        self.address = address
        self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        if self.sock.connect_ex(address) == 0:
    	    self.sock.setblocking(0)
            reactor.addReader(self)
        else:
            print &#039;Could not connect to Task&#039;, task_num

It works with one or more of my servers off, but is it better to look for the error somewhere else?</description>
		<content:encoded><![CDATA[<p>Thanks for the great tutorials. I&#8217;m really learning a lot!</p>
<p>For exercise 1, I modified &#8216;init&#8217; as follows:</p>
<p>    def __init__(self, task_num, address):<br />
        self.task_num = task_num<br />
        self.address = address<br />
        self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)<br />
        if self.sock.connect_ex(address) == 0:<br />
    	    self.sock.setblocking(0)<br />
            reactor.addReader(self)<br />
        else:<br />
            print &#8216;Could not connect to Task&#8217;, task_num</p>
<p>It works with one or more of my servers off, but is it better to look for the error somewhere else?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on An Introduction to Asynchronous Programming and Twisted by dave</title>
		<link>http://krondo.com/?p=1333&#038;cpage=1#comment-8208</link>
		<dc:creator>dave</dc:creator>
		<pubDate>Thu, 19 Apr 2012 19:08:19 +0000</pubDate>
		<guid isPermaLink="false">http://krondo.com/blog/?p=1333#comment-8208</guid>
		<description>Yes, you are right that it is about the same amount of work (the 100 requests
do have the extra function call overhead). And while a callback (any callback)
is running, the reactor cannot service any other requests. If your server only
ever handles one request at a time, then it wouldn&#039;t make any difference. Of
course, if your server only handles one request at a time, then there&#039;s no
real reason to use the asynchronous model either.</description>
		<content:encoded><![CDATA[<p>Yes, you are right that it is about the same amount of work (the 100 requests<br />
do have the extra function call overhead). And while a callback (any callback)<br />
is running, the reactor cannot service any other requests. If your server only<br />
ever handles one request at a time, then it wouldn&#8217;t make any difference. Of<br />
course, if your server only handles one request at a time, then there&#8217;s no<br />
real reason to use the asynchronous model either.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on An Introduction to Asynchronous Programming and Twisted by Fred</title>
		<link>http://krondo.com/?p=1333&#038;cpage=1#comment-8206</link>
		<dc:creator>Fred</dc:creator>
		<pubDate>Thu, 19 Apr 2012 18:59:35 +0000</pubDate>
		<guid isPermaLink="false">http://krondo.com/blog/?p=1333#comment-8206</guid>
		<description>Hi Dave! Thanks for tutorial, I really like the way you explain.

One question I have is, how does Twisted benefits from smaller tasks (callbacks)? Would it make any difference for one single request, if I do say 100 smaller callbacks instead of 10 bigger? In the end, its the same amount of work. And those callbacks do they work actually blocking the reactor for a small period of time, right?</description>
		<content:encoded><![CDATA[<p>Hi Dave! Thanks for tutorial, I really like the way you explain.</p>
<p>One question I have is, how does Twisted benefits from smaller tasks (callbacks)? Would it make any difference for one single request, if I do say 100 smaller callbacks instead of 10 bigger? In the end, its the same amount of work. And those callbacks do they work actually blocking the reactor for a small period of time, right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on An Introduction to Asynchronous Programming and Twisted by dave</title>
		<link>http://krondo.com/?p=1682&#038;cpage=1#comment-8177</link>
		<dc:creator>dave</dc:creator>
		<pubDate>Mon, 16 Apr 2012 04:20:11 +0000</pubDate>
		<guid isPermaLink="false">http://krondo.com/blog/?p=1682#comment-8177</guid>
		<description>Certainly, but in your pseudo-code you are calling &lt;code&gt;callLater&lt;/code&gt;
immediately, instead of in the callback. What you want is something like:

&lt;blockquote&gt;&lt;code&gt;d.addCallback(lambda res: reactor.callLater(...))&lt;/code&gt;&lt;/blockquote&gt;

Makes sense?</description>
		<content:encoded><![CDATA[<p>Certainly, but in your pseudo-code you are calling <code>callLater</code><br />
immediately, instead of in the callback. What you want is something like:</p>
<blockquote><p><code>d.addCallback(lambda res: reactor.callLater(...))</code></p></blockquote>
<p>Makes sense?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on An Introduction to Asynchronous Programming and Twisted by Gokul</title>
		<link>http://krondo.com/?p=1682&#038;cpage=1#comment-8176</link>
		<dc:creator>Gokul</dc:creator>
		<pubDate>Mon, 16 Apr 2012 02:39:45 +0000</pubDate>
		<guid isPermaLink="false">http://krondo.com/blog/?p=1682#comment-8176</guid>
		<description>Hi Dave, I have another question: 
Is there a way I can add a callback that will invoke a calllater? In pseudo code this is what I want to do:
d = maybeDeferred(....)
d.addCallback(method1)
if condition is true:
d.addCallback(callLater(delay, method2, return-from-method1))</description>
		<content:encoded><![CDATA[<p>Hi Dave, I have another question:<br />
Is there a way I can add a callback that will invoke a calllater? In pseudo code this is what I want to do:<br />
d = maybeDeferred(&#8230;.)<br />
d.addCallback(method1)<br />
if condition is true:<br />
d.addCallback(callLater(delay, method2, return-from-method1))</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on An Introduction to Asynchronous Programming and Twisted by asuwill</title>
		<link>http://krondo.com/?p=2048&#038;cpage=1#comment-8172</link>
		<dc:creator>asuwill</dc:creator>
		<pubDate>Mon, 16 Apr 2012 00:15:36 +0000</pubDate>
		<guid isPermaLink="false">http://krondo.com/blog/?p=2048#comment-8172</guid>
		<description>Thank you very much</description>
		<content:encoded><![CDATA[<p>Thank you very much</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on An Introduction to Asynchronous Programming and Twisted by dave</title>
		<link>http://krondo.com/?p=2048&#038;cpage=1#comment-8168</link>
		<dc:creator>dave</dc:creator>
		<pubDate>Sun, 15 Apr 2012 16:26:37 +0000</pubDate>
		<guid isPermaLink="false">http://krondo.com/blog/?p=2048#comment-8168</guid>
		<description>Hello, glad you like the tutorials!

&lt;ol&gt;
	&lt;li&gt;You are right that file i/o is a blocking and potentially time-consuming operation. If the files are relatively small and you have a fast local disk, then you may be able to go ahead and read them in your callbacks. Otherwise, you have some options. You could load them in a thread, or read them in small chunks, returning control to the reactor after each chunk, or launch a subprocess to read them. You will need to measure to find out which is best for your situation.&lt;/li&gt;
	&lt;li&gt;For the common frameworks (like GTK and Qt), Twisted is able to use the native GUI event loop instead of its own, so in the end you only have one event loop after all. Google for the &#039;twisted gtk reactor&#039; for some examples.&lt;/li&gt;
&lt;/ol&gt;</description>
		<content:encoded><![CDATA[<p>Hello, glad you like the tutorials!</p>
<ol>
<li>You are right that file i/o is a blocking and potentially time-consuming operation. If the files are relatively small and you have a fast local disk, then you may be able to go ahead and read them in your callbacks. Otherwise, you have some options. You could load them in a thread, or read them in small chunks, returning control to the reactor after each chunk, or launch a subprocess to read them. You will need to measure to find out which is best for your situation.</li>
<li>For the common frameworks (like GTK and Qt), Twisted is able to use the native GUI event loop instead of its own, so in the end you only have one event loop after all. Google for the &#8216;twisted gtk reactor&#8217; for some examples.</li>
</ol>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: krondo.com @ 2012-05-18 12:12:00 -->
