<DIV>If it looks like polling and acts like polling, when is it not polling?</DIV>
<DIV>--When its incrimental computing!</DIV>
<DIV>&nbsp;</DIV>
<DIV>I've updated the project web pages to cover the Twisted integration:</DIV>
<DIV>&nbsp;&nbsp;&nbsp; <A href="http://compstrm.sourceforge.net">http://compstrm.sourceforge.net</A></DIV>
<DIV>But It really does not address this issue.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Polling, or rather, unnecessary polling is EVIL, especially in a </DIV>
<DIV>framework like Twisted. Its an even greater sin than using BLOCKING</DIV>
<DIV>I/O for reading email files that could be very very large. ;-)</DIV>
<DIV>&nbsp;</DIV>
<DIV>But polling is when you are checking something, like I/O completion.</DIV>
<DIV>That's NOT what is happening in CompStrm. Instead, CompStrm is</DIV>
<DIV>executing (hopefully!) useful application code, in small chunks.</DIV>
<DIV>&nbsp;</DIV>
<DIV>When is this useful? Well, when you have some long-running </DIV>
<DIV>application code, the alternative is to execute it on a separate thread.</DIV>
<DIV>Indeed, this is a good solution. Except that not everyone can debug</DIV>
<DIV>some of the nasties that occur. And then you've got all that overhead</DIV>
<DIV>and the delays that seem to be part of inter-task communication.</DIV>
<DIV>So you start optimizing to pass large chuncks between threads and,</DIV>
<DIV>woops, there goes your response time. (The old fast or cheap choice.)</DIV>
<DIV>&nbsp;</DIV>
<DIV>CompStrm also integrates well with async I/O, allowing you to untwist</DIV>
<DIV>your logic a bit. Have you read anything about Stackless Python? This</DIV>
<DIV>is similar, but builds on Python Generators instead.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Does any of this help?</DIV>
<DIV>&nbsp;</DIV>
<DIV>And as for applications, indeed, CompStrm developed from the latest </DIV>
<DIV>requests my client has given me. I've got a client/server app with an</DIV>
<DIV>asynchronous interface used to compute just-in-time displays of multiple</DIV>
<DIV>streams. Now he wants the existing operations pushed into scripts.</DIV>
<DIV>With compstrm, I can have light-weight child processes sharing the</DIV>
<DIV>same I/O streams. I want to port all this to Twisted, but need several</DIV>
<DIV>additions: CompStrm and a good bsddb integration.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Now that I've completed the Twisted/CompStrm integration, I'll turn to</DIV>
<DIV>Twisted/bsddb integration. Be assured, I will not include CompStrm in</DIV>
<DIV>that integration!!! (It should be generally useful, and provide a means</DIV>
<DIV>of reading potentially large data using server threads, while minimizing</DIV>
<DIV>inter-thread overheads.)</DIV>
<DIV>&nbsp;</DIV>
<DIV>Bill<BR><BR><B><I>Christopher Armstrong &lt;radix@twistedmatrix.com&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Indeed, it sounds like what you're doing doesn't make any sense. Why do <BR>you need to call something every mainloop iteration? That's exactly the <BR>worst way to write asynchronous code. Polling sucks. :)<BR><BR>Maybe you can explain more about what you're doing? What *applications* <BR>do you have in mind that this thing would be good for? (I notice that <BR>your web site's first sentence mentions how great it would be to create <BR>applications from components, but the web site doesn't mention anything <BR>at all about existing or even theoretical applications).<BR></BLOCKQUOTE><p><font face=arial size=-1>
<a href="http://in.rd.yahoo.com/specials/mailtg/*http://yahoo.shaadi.com/india-matrimony/" target="_blank">
<b>Yahoo! India Matrimony</a>:</b> Find your partner 
<a href="http://in.rd.yahoo.com/specials/mailtg2/*http://yahoo.shaadi.com/india-matrimony/community.php" target="_blank">online</a>.</font>