2) Can I do something like this if I want to have only one thread instead of two (or three in case if I have to create anothed one for merge operator)?
auto sc = rxcpp::schedulers::make_new_thread();
auto w = sc.create_worker();
auto so = rxcpp::identity_same_worker(w);
auto src1 = rxcpp::sources::interval(std::chrono::seconds(1), so)
.map([](auto i){
return "1# i: " + std::to_string(i);
});
auto src2 = rxcpp::sources::interval(std::chrono::milliseconds(500), so)
.map([](auto i){
return "2# i: " + std::to_string(i);
});
src1
.merge(src2)
.subscribe([](auto s){
std::cout << s << std::endl;
});
Hi, I have few questions
1) Do I need to add scheduler to merge operator in this code? When do I have to provide it and why?
2) Can I do something like this if I want to have only one thread instead of two (or three in case if I have to create anothed one for merge operator)?