<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>"Push" LINQ revisited - next attempt at an explanation</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/01/04/quot-push-quot-linq-revisited-next-attempt-at-an-explanation.aspx</link><description>Marc Gravell and I have now implemented a lot of LINQ standard query operators on the &amp;quot;push&amp;quot; model of IDataProducer as opposed to the &amp;quot;pull&amp;quot; model of IEnumerable. My good friend Douglas Leeder (who doesn&amp;#39;t use C#) has been with</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Efficient "vote counting" with LINQ to Objects - and the value of nothing</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/01/04/quot-push-quot-linq-revisited-next-attempt-at-an-explanation.aspx#1725263</link><pubDate>Sun, 20 Sep 2009 20:48:27 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1725263</guid><dc:creator>Jon Skeet: Coding Blog</dc:creator><description>&lt;p&gt;A long time ago, I&amp;#39;m pretty sure I started writing Push LINQ in response to a request to effectively&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1725263" width="1" height="1"&gt;</description></item><item><title>re: "Push" LINQ revisited - next attempt at an explanation</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/01/04/quot-push-quot-linq-revisited-next-attempt-at-an-explanation.aspx#1707085</link><pubDate>Thu, 23 Jul 2009 19:44:19 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1707085</guid><dc:creator>skeet</dc:creator><description>&lt;p&gt;@Jeff:&lt;/p&gt;
&lt;p&gt;I now have DataProducer.PumpProduceAndEnd; it&amp;#39;s probably easier to look at the code (in MiscUtil) than explain. Basically it takes a &amp;quot;final results&amp;quot; enumerable and yields any values produced by that, pumping more data into the pipeline when there&amp;#39;s nothing being yielded. Unfortunately this introduces buffering, but it&amp;#39;s relatively minimal.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1707085" width="1" height="1"&gt;</description></item><item><title>re: "Push" LINQ revisited - next attempt at an explanation</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/01/04/quot-push-quot-linq-revisited-next-attempt-at-an-explanation.aspx#1707075</link><pubDate>Thu, 23 Jul 2009 19:25:44 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1707075</guid><dc:creator>Jeff</dc:creator><description>&lt;p&gt;Tremendous!&lt;/p&gt;
&lt;p&gt;Could you pass &amp;#39;query&amp;#39; into the ProduceAndEnd() method, have it create &amp;#39;results&amp;#39; (calling query.AsEnumerable()), then return results from ProduceAndEnd()?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1707075" width="1" height="1"&gt;</description></item><item><title>re: "Push" LINQ revisited - next attempt at an explanation</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/01/04/quot-push-quot-linq-revisited-next-attempt-at-an-explanation.aspx#1696823</link><pubDate>Fri, 26 Jun 2009 22:50:17 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1696823</guid><dc:creator>Marc Gravell</dc:creator><description>&lt;p&gt;@Keith - a bit overdue now (I was just passing), but the observers can take themselves out of the loop fairly easily - the First/Take etc implementations do exactly this.&lt;/p&gt;
&lt;p&gt;More importantly, if they have something chained watching data from *them*, they send the &amp;quot;all done&amp;quot; signal at this early time - so the result of your .Where(...).Take(10).Sum() can be available long before the &amp;quot;real&amp;quot; data feed has finished... as soon as we&amp;#39;ve seen 10 items, we can (and do) sum them.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1696823" width="1" height="1"&gt;</description></item><item><title>re: "Push" LINQ revisited - next attempt at an explanation</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/01/04/quot-push-quot-linq-revisited-next-attempt-at-an-explanation.aspx#1687355</link><pubDate>Tue, 14 Apr 2009 07:52:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1687355</guid><dc:creator>Keith J. Farmer</dc:creator><description>&lt;p&gt;I&amp;#39;ve seen this pattern before, even recently. &amp;nbsp;It&amp;#39;s well-worth the study.&lt;/p&gt;
&lt;p&gt;The decision to make is who controls when to halt the data. &amp;nbsp;The &amp;quot;Push&amp;quot; model places that decision at the data source, whereas the &amp;quot;Pull&amp;quot; model, naturally, places it with the requester. &amp;nbsp;Both are valid choices to make, based on the nature of the two ends involved (eg, is one end a serial port, or are you wanting to truncate the data after finding the first Foo?).&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1687355" width="1" height="1"&gt;</description></item><item><title>re: "Push" LINQ revisited - next attempt at an explanation</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/01/04/quot-push-quot-linq-revisited-next-attempt-at-an-explanation.aspx#1657230</link><pubDate>Fri, 19 Dec 2008 12:00:39 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1657230</guid><dc:creator>skeet</dc:creator><description>&lt;p&gt;@David Cater: Just download MiscUtil (&lt;a rel="nofollow" target="_new" href="http://pobox.com/~skeet/csharp/miscutil"&gt;pobox.com/.../miscutil&lt;/a&gt;) - it&amp;#39;s all in there.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1657230" width="1" height="1"&gt;</description></item><item><title>re: "Push" LINQ revisited - next attempt at an explanation</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/01/04/quot-push-quot-linq-revisited-next-attempt-at-an-explanation.aspx#1657228</link><pubDate>Fri, 19 Dec 2008 11:53:06 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1657228</guid><dc:creator>David Cater</dc:creator><description>&lt;p&gt;Very nice. &amp;nbsp;Any chance that you&amp;#39;ll be posting the DataProducer source code, or do you just plan on publishing that as a binary?&lt;/p&gt;
&lt;p&gt;Thanks for the article!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1657228" width="1" height="1"&gt;</description></item><item><title>a digital aesthetic  &amp;mdash; Push vs Pull Linq</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/01/04/quot-push-quot-linq-revisited-next-attempt-at-an-explanation.aspx#1655285</link><pubDate>Fri, 21 Nov 2008 17:14:53 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1655285</guid><dc:creator>a digital aesthetic  — Push vs Pull Linq</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;a digital aesthetic &amp;nbsp;&amp;mdash; Push vs Pull Linq&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1655285" width="1" height="1"&gt;</description></item><item><title>re: "Push" LINQ revisited - next attempt at an explanation</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/01/04/quot-push-quot-linq-revisited-next-attempt-at-an-explanation.aspx#1643895</link><pubDate>Fri, 08 Aug 2008 08:07:51 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1643895</guid><dc:creator>skeet</dc:creator><description>&lt;p&gt;Will have to get my head back into Push LINQ to properly understand your suggestion, but I&amp;#39;ll look at it :)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1643895" width="1" height="1"&gt;</description></item><item><title>re: "Push" LINQ revisited - next attempt at an explanation</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/01/04/quot-push-quot-linq-revisited-next-attempt-at-an-explanation.aspx#1643893</link><pubDate>Fri, 08 Aug 2008 08:02:05 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1643893</guid><dc:creator>Fredrik Kalseth</dc:creator><description>&lt;p&gt;Very cool stuff! :)&lt;/p&gt;
&lt;p&gt;A thought: why not have a factory method on the DataProducer so that to create a query (as in the last example in your post) you do &lt;/p&gt;
&lt;p&gt;var query = voters.Query( from voter in voters.... );&lt;/p&gt;
&lt;p&gt;This method could then hide the AsEnumerable() &amp;#39;hack&amp;#39;, and it would sit nicely next to the IFuture&amp;lt;&amp;gt; methods on there aswell.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1643893" width="1" height="1"&gt;</description></item><item><title>Data pipelines as a conceptual stepping stone to higher order functions</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/01/04/quot-push-quot-linq-revisited-next-attempt-at-an-explanation.aspx#1526365</link><pubDate>Thu, 28 Feb 2008 00:08:42 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1526365</guid><dc:creator>Jon Skeet: Coding Blog</dc:creator><description>&lt;p&gt;I was explaining data pipelines in LINQ to Objects to a colleague yesterday, partly as the next step&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1526365" width="1" height="1"&gt;</description></item><item><title>re: "Push" LINQ revisited - next attempt at an explanation</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/01/04/quot-push-quot-linq-revisited-next-attempt-at-an-explanation.aspx#1495617</link><pubDate>Mon, 04 Feb 2008 19:10:52 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1495617</guid><dc:creator>Dennis van der Stelt</dc:creator><description>&lt;p&gt;Finally found the time for some reading. Excellent explanation, I love the pictures!&lt;/p&gt;
&lt;p&gt;Be sure to blog about this more in the future!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1495617" width="1" height="1"&gt;</description></item><item><title>Random Reading: Push Linq &amp;laquo; Tales from a Trading Desk</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/01/04/quot-push-quot-linq-revisited-next-attempt-at-an-explanation.aspx#1464525</link><pubDate>Tue, 15 Jan 2008 18:51:48 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1464525</guid><dc:creator>Random Reading: Push Linq « Tales from a Trading Desk</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Random Reading: Push Linq &amp;amp;laquo; Tales from a Trading Desk&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1464525" width="1" height="1"&gt;</description></item><item><title>re: "Push" LINQ revisited - next attempt at an explanation</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/01/04/quot-push-quot-linq-revisited-next-attempt-at-an-explanation.aspx#1454278</link><pubDate>Fri, 11 Jan 2008 03:18:03 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1454278</guid><dc:creator>Luke Marshall</dc:creator><description>&lt;p&gt;Awesome idea, excellent explanation!&lt;/p&gt;
&lt;p&gt;Keep it up!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1454278" width="1" height="1"&gt;</description></item><item><title>re: "Push" LINQ revisited - next attempt at an explanation</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/01/04/quot-push-quot-linq-revisited-next-attempt-at-an-explanation.aspx#1453598</link><pubDate>Thu, 10 Jan 2008 20:45:11 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1453598</guid><dc:creator>skeet</dc:creator><description>&lt;p&gt;Ara, it's not clear whether you mean &amp;quot;push&amp;quot; LINQ or LINQ in general. Furthermore, I certainly haven't seen LINQ taking an order of magnitude out of performance, when used properly. Evidence?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1453598" width="1" height="1"&gt;</description></item><item><title>re: "Push" LINQ revisited - next attempt at an explanation</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/01/04/quot-push-quot-linq-revisited-next-attempt-at-an-explanation.aspx#1453530</link><pubDate>Thu, 10 Jan 2008 20:31:58 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1453530</guid><dc:creator>Ara</dc:creator><description>&lt;p&gt;Too slow, too bloated and killing a machine by further order of magnitude (another 0 added).&lt;/p&gt;
&lt;p&gt;LINQ finally out of hype, try and attempt the same with imperative code.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1453530" width="1" height="1"&gt;</description></item><item><title>Random Reading: F#, Linq, ToyScript &amp;laquo; Tales from a Trading Desk</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/01/04/quot-push-quot-linq-revisited-next-attempt-at-an-explanation.aspx#1451103</link><pubDate>Wed, 09 Jan 2008 23:48:36 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1451103</guid><dc:creator>Random Reading: F#, Linq, ToyScript « Tales from a Trading Desk</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Random Reading: F#, Linq, ToyScript &amp;amp;laquo; Tales from a Trading Desk&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1451103" width="1" height="1"&gt;</description></item></channel></rss>