c# - BehaviourSubject and CombineLatest - Weird behaviour -


given following code.

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); 

why print?

0 1 0 1 0 1 ... 

instead of:

0 1 1 1 1 1 ... 

first of output looks strange. both of them. guess output should be:

1 1 1 1 1 

without 0. because of first interval value produced in 1 second - after call subject.onnext(1);

the other strage thing behavioursubject<int> - uk version of behaviorsubject(of t) ? :) if have own behavioursubject implementation, please extend question it.


Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -