ReactivePlusPlus
One more implementation of ReactiveX approach in C++ with care about performance and templates in mind
 
Loading...
Searching...
No Matches
multicast.cpp
#include <rpp/rpp.hpp>
#include <iostream>
int main()
{
auto observable = rpp::source::just(1, 2, 3).multicast(subject);
observable.subscribe([](int v) {std::cout << "#1 " << v << std::endl; });
observable.subscribe([](int v) {std::cout << "#2 " << v << std::endl; });
observable.connect();
// Output:
// #1 1
// #2 1
// #1 2
// #2 2
// #1 3
// #2 3
return 0;
}
Subject which just multicasts values to observers subscribed on it. It contains two parts: subscriber...
Definition: publish_subject.hpp:78