#include <rpp/rpp.hpp>
#include <iostream>
int main()
{
{
std::cout << "SUBSCRIBE" << std::endl;
for (int i = 0; i < 3; ++i)
{
observer.on_next(i);
}
observer.on_completed();
})
std::cout << "subscribe first" << std::endl;
observable.subscribe([](int v) { std::cout << "#1 " << v << std::endl; });
std::cout << "subscribe with ref_count" << std::endl;
observable.ref_count().subscribe([](int v) { std::cout << "#2 " << v << std::endl; });
}
{
observable.subscribe([](int v) { std::cout << "#1 " << v << std::endl; });
observable | rpp::ops::ref_count() | rpp::ops::subscribe([](int v) { std::cout << "#2 " << v << std::endl; });
}
return 0;
}
auto multicast()
Converts ordinary observable to rpp::connectable_observable with help of inline instsantiated subject...
Definition multicast.hpp:85
auto just(const TScheduler &scheduler, T &&item, Ts &&... items)
Creates rpp::observable that emits a particular items and completes.
Definition from.hpp:201
auto create(OnSubscribe &&on_subscribe)
Construct observable specialized with passed callback function. Most easiesest way to construct obser...
Definition create.hpp:57