#include <rpp/rpp.hpp>
#include "rpp/sources/fwd.hpp"
#include <iostream>
int main()
{
| rpp::ops::map([](int v) {
std::cout << "value in map" << v << std::endl;
return v;
})
| rpp::ops::publish();
std::cout << "CONNECT" << std::endl;
auto d = observable.connect();
std::this_thread::sleep_for(std::chrono::milliseconds{150});
std::cout << "SUBSCRIBE" << std::endl;
observable.subscribe([](int v) { std::cout << "observer value " << v << std::endl; });
std::this_thread::sleep_for(std::chrono::milliseconds{150});
d.dispose();
std::cout << "DISPOSE" << std::endl;
std::this_thread::sleep_for(std::chrono::milliseconds{150});
}
Scheduler which schedules invoking of schedulables to another thread via queueing tasks with priority...
Definition new_thread.hpp:31
auto interval(rpp::schedulers::duration initial, rpp::schedulers::duration period, TScheduler &&scheduler)
Creates rpp::observable that emits a sequential integer every specified time interval,...
Definition interval.hpp:72