ReactivePlusPlus
One more implementation of ReactiveX approach in C++ with care about performance and templates in mind
 
Loading...
Searching...
No Matches
from.cpp
#include <rpp/rpp.hpp>
#include <iostream>
int main()
{
{
std::vector<int> vals{ 1,2,3 };
rpp::source::from_iterable(vals).subscribe([](int v) {std::cout << v << " "; });
}
{
std::vector<int> vals{ 1,2,3 };
rpp::source::from_iterable<rpp::memory_model::use_shared>(vals).subscribe([](int v) {std::cout << v << " "; });
}
{
std::vector<int> vals{ 1,2,3 };
rpp::source::from_iterable(vals, rpp::schedulers::new_thread{}).as_blocking().subscribe([](int v) {std::cout << v << " "; });
}
{
rpp::source::from_callable([]() {return 49; }).subscribe([](int v) {std::cout << v << " "; });
// Output: 49
}
return 0;
}
scheduler which schedules execution of schedulables via queueing tasks to another thread with priorit...
Definition: new_thread_scheduler.hpp:32