Confusion over behavior of Publish().Refcount() <p>I've got a simple program here that displays the number of letters in various words. It works as expected.</p> <pre><code>static void Main(string[] args) { var word = new Subject&lt;string&gt;(); var wordPub = word.Publish().RefCount(); var length = word.Select(i =&gt; i.Length); var report = wordPub .GroupJoin(length, s =&gt; wordPub, s =&gt; Observable.Empty&lt;int&gt;(), (w, a) =&gt; new { Word = w, Lengths = a }) .SelectMany(i =&gt; i.Lengths.Select(j =&gt; new { Word = i.Word, Length = j })); report.Subscribe(i =&gt; Console.WriteLine($"{i.Word} {i.Length}")); word.OnNext("Apple"); word.OnNext("Banana"); word.OnNext("Cat"); word.OnNext("Donkey"); word.OnNext("Elephant"); word.OnNext("Zebra"); Console.ReadLine(); } </code></pre> <p>And the output is:</p> <pre><code>Apple 5 Banana 6 Cat 3 Donkey 6 Elephant 8 Zebra 5 </code></pre> <p>I used the Publish().RefCount() because "wordpub" is included in "report" twice. Without it, when a word is emitted first one part of the report would get notified by a callback, and then the other part of report would be notified, double the notifications. That is kindof what happens; the output ends up having 11 items rather than 6. At least that is what I think is going on. I think of using Publish().RefCount() in this situation as simultaneously updating both parts of the report.</p> <p>However if I change the length function to ALSO use the published source like this:</p> <pre><code>var length = wordPub.Select(i =&gt; i.Length); </code></pre> <p>Then the output is this:</p> <pre><code>Apple 5 Apple 6 Banana 6 Cat 3 Banana 3 Cat 6 Donkey 6 Elephant 8 Donkey 8 Elephant 5 Zebra 5 </code></pre> <p>Why can't the length function also use the same published source?</p>