ReactivePlusPlus
ReactiveX implementation for C++20
Loading...
Searching...
No Matches
repeat.cpp
#include <rpp/rpp.hpp>
#include <exception>
#include <iostream>
int main()
{
| rpp::operators::subscribe([](int v) { std::cout << v << " "; },
[](const std::exception_ptr&) {},
[]() { std::cout << "completed" << std::endl; });
// Output: 1 2 3 1 2 3 completed
| rpp::operators::subscribe([](int v) { std::cout << v << " "; },
[](const std::exception_ptr&) {},
[]() {
std::cout << "completed" << std::endl;
});
// Output: 1 2 3 1 2 3 1 2 3 1 completed
return 0;
}
auto just(const TScheduler &scheduler, T &&item, Ts &&... items)
Creates rpp::observable that emits a particular items and completes.
Definition from.hpp:201
auto take(size_t count)
Emit only first count items provided by observable, then send on_completed
Definition take.hpp:92
auto subscribe(observer< Type, ObserverStrategy > &&observer)
Subscribes passed observer to emissions from this observable.
Definition subscribe.hpp:226
auto repeat()
Repeats the Observabe's sequence of emissions infinite amount of times via re-subscribing on it durin...
Definition repeat.hpp:86