For this particular Observable circuit with this particular version of RxJS, the order of emissions will always be the same.
As already mentioned, in RxJS 4 it uses the currentThread scheduler, as you can see here: https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/perf/operators/range.js#L39 .
All schedulers (except immediate from RxJS 4) internally use some type of queue , so the order is always the same.
The order of events is very similar to what you showed in the diagram (... or, at least, I think it is):
Note that this behavior is different in RxJS 4 and RxJS 5.
In RxJS 5, most observers and operators do not use any scheduler by default (the obvious exception is the Observables / operators, which should work with delays). Thus, in RxJS 5, RangeObservable will not schedule anything and will immediately start emitting values in the loop.
The same example in RxJS 5 will give a different result:
const source = Observable .range(1, 3) .switchMap(function (x) { return Observable.range(x * 100, 2); }); source.subscribe(value => console.log('I got a value ', value));
This will print the following:
I got a value 100 I got a value 101 I got a value 200 I got a value 201 I got a value 300 I got a value 301
However, this will change significantly if you add, for example, delay(0) . Common sense dictates that this should do nothing:
const source = Observable .range(1, 3) .switchMap(function (x) { return Observable.range(x * 100, 2).delay(0); }); source.subscribe(value => console.log('I got a value ', value));
Now only the internal RangeObservable planned and placed over and over several times, because of which it emits only the values from the most recent RangeObservable :
I got a value 300 I got a value 301