12#include <rpp/observables/constraints.hpp>
13#include <rpp/subscribers/specific_subscriber.hpp>
14#include <rpp/observers/state_observer.hpp>
16#include <rpp/observables/details/member_overload.hpp>
17#include <rpp/operators/fwd.hpp>
18#include <rpp/defs.hpp>
20#include <rpp/operators/details/subscriber_with_state.hpp>
32template<constra
int::decayed_type Type, constra
int::observable_of_type<Type> OriginalObservable>
37 : m_original{original} {}
40 : m_original{std::move(original)} {}
45 template<constraint::subscriber_of_type<Type> TSub>
46 void subscribe_impl(TSub&& subscriber) const noexcept
48 if (!subscriber.is_subscribed())
51 std::promise<bool> is_success{};
52 const auto future = is_success.get_future();
53 auto sub = subscriber.get_subscription();
54 m_original.subscribe(create_subscriber_with_state<Type>(std::move(sub),
55 utils::forwarding_on_next{},
56 [&](
const std::exception_ptr& err,
const auto& sub)
59 is_success.set_value(
false);
64 is_success.set_value(
true);
66 std::forward<TSub>(subscriber)));
71 OriginalObservable m_original;
74template<constra
int::observable TObs>
75blocking_observable(
const TObs&)->blocking_observable<rpp::utils::extract_observable_type_t<TObs>, TObs>;
blocking alternative of observable: provides interface where each function do blocking subscribe on o...
Definition: blocking_observable.hpp:34
Definition: member_overload.hpp:19