We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I have few questions
Do I need to add scheduler to merge operator in this code? When do I have to provide it and why?
auto src1 = rxcpp::sources::interval(std::chrono::seconds(1), rxcpp::observe_on_new_thread()) .map([](auto i){ return "1# i: " + std::to_string(i); });
auto src2 = rxcpp::sources::interval(std::chrono::milliseconds(500), rxcpp::observe_on_new_thread()) .map([](auto i){ return "2# i: " + std::to_string(i); });
src1 .merge(src2) .subscribe([](auto s){ std::cout << s << std::endl; });
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); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi, I have few questions
Do I need to add scheduler to merge operator in this code? When do I have to provide it and why?
auto src1 = rxcpp::sources::interval(std::chrono::seconds(1), rxcpp::observe_on_new_thread())
.map([](auto i){
return "1# i: " + std::to_string(i);
});
auto src2 = rxcpp::sources::interval(std::chrono::milliseconds(500), rxcpp::observe_on_new_thread())
.map([](auto i){
return "2# i: " + std::to_string(i);
});
src1
.merge(src2)
.subscribe([](auto s){
std::cout << s << std::endl;
});
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;
});
The text was updated successfully, but these errors were encountered: