This is a rather educational, out of curiosity question. Consider the following snippet:
var enumerable = Enumerable.Range(0, 5); var observable = enumerable.ToObservable(); var enu = observable.Concat(observable).ToEnumerable(); enu.ToObservable().SubscribeDebug(); Where SubscribeDebug subscribes a simple observer:
public class DebugObserver<T> : IObserver<T> { public void OnCompleted() { Debug.WriteLine("Completed"); } public void OnError(Exception error) { Debug.WriteLine("Error"); } public void OnNext(T value) { Debug.WriteLine("Value: {0}", value); } } The output of this is:
Value: 0
Value: 1
Value: 2
Value: 3
Value: 4
And then blocks. Can someone help me understand the underlying reason why it happens and why the observable does not complete? I have noticed that it does complete without the Concat call, but blocks with it.