Let's examine one critical aspect of the contract offered by
IObservable: Once an observable sequence terminates with
OnError, no more items can be produced.
This raises the question: how do you get work done if
OnError interrupt the flow with such finality? This section will examine this dilemma and the solution.
The finality of
OnCompleted is illustrated in the following example, which schedules a number of values to be observed, but interrupts with
OnCompleted after the second value:
var sched = new TestScheduler(); var input = sched.CreateColdObservable( sched.OnNextAt(200, 1), sched.OnNextAt(300, 10), sched.OnCompletedAt<int>(350.0), ...