-
Couldn't load subscription status.
- Fork 404
Description
I have the following code that crashes. It is a RX subscription that is supposed to iterate data sequentially (Here it is not substantial but if I introduce delay after just it will be the case).
I understand how a scheduler (coordinator) works for a deferred operation (like delay) but I don't know what is the point to supply the coordinator to the sources (such as just or iterate). I simply put the same coordinator to every rx function that takes the coordinator but in this case apparently it fails. I found that if I remove the coordinator in just it will run correctly.
I wonder why shouldn't I use the coordinator in this case and when should I use it?
schedulers::run_loop rl;
identity_one_worker c(schedulers::make_run_loop(rl));
sources::iterate(data, c)
.concat_map(
[&](int v) {
return sources::just(v, c);
},
c)
.subscribe([](int v) {
std::cout << "Next " << v << "\n";
});
while (true) {
rl.dispatch();
}