ReactivePlusPlus
ReactiveX implementation for C++20
Loading...
Searching...
No Matches
retry.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 << "error" << std::endl; },
[]() { std::cout << "completed" << std::endl; });
// Output: 1 2 3 1 2 3 1 2 3 error
| rpp::operators::subscribe([](int v) { std::cout << v << " "; },
[](const std::exception_ptr&) { std::cout << "error" << std::endl; },
[]() { 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 error(std::exception_ptr err)
Creates rpp::observable that emits no items and terminates with an error.
Definition error.hpp:49
auto concat(TObservable &&obs, TObservables &&... others)
Make observable which would merge emissions from underlying observables but without overlapping (curr...
Definition concat.hpp:171
auto retry()
The infinite retry operator continuously attempts to resubscribe to the observable upon error,...
Definition retry.hpp:170
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