给定以下代码。
EventLoopScheduler scheduler = new EventLoopScheduler(ts => new Thread(ts));
BehaviorSubject<int> subject = new BehaviorSubject<int>(0);
subject
.ObserveOn(scheduler)
.CombineLatest(Observable.Interval(TimeSpan.FromSeconds(1), scheduler), (x, y) => x)
.Subscribe(x => Debug.WriteLine(x));
subject.OnNext(1);
为什么要打印?
0
1
0
1
0
1
...
代替:
0
1
1
1
1
1
...