I have this code:
var s1 = new Subject<Unit>();
var s2 = new Subject<Unit>();
var ss = s1.Merge(s2).Finally(() => Console.WriteLine("Finished!"));
ss.Subscribe(_ => Console.WriteLine("Next"));
s1.OnNext(new Unit());
s2.OnNext(new Unit());
s1.OnCompleted(); // I wish ss finished here.
s2.OnCompleted(); // Yet it does so here. =(
I've solved my problem using OnError(new OperationCanceledException()), but I'd like a better solution (there has to be a combinator right?).
Or this, which is also quite neat:
This uses a subject which will make sure only one OnCompleted is pushed to the observer in the CreateWithDisposable();