summaryrefslogtreecommitdiff
path: root/Rx/v2/src/rxcpp/rx-observable.hpp
diff options
context:
space:
mode:
authorGrigoriy Chudnov <g.chudnov@gmail.com>2016-12-16 00:21:33 +0300
committerKirk Shoop <kirk.shoop@microsoft.com>2016-12-16 07:19:30 -0800
commit92e14a4ff831e0716b96788f1cb624f713e446ff (patch)
treef3415b983964989aface89383fc00d8f881f5fba /Rx/v2/src/rxcpp/rx-observable.hpp
parent2a8f3cc2102f4b4bf5bd3485f357db2a77863168 (diff)
downloadRxCpp-92e14a4ff831e0716b96788f1cb624f713e446ff.tar.gz
decouple retry from observable
Diffstat (limited to 'Rx/v2/src/rxcpp/rx-observable.hpp')
-rw-r--r--Rx/v2/src/rxcpp/rx-observable.hpp42
1 files changed, 5 insertions, 37 deletions
diff --git a/Rx/v2/src/rxcpp/rx-observable.hpp b/Rx/v2/src/rxcpp/rx-observable.hpp
index cda8029..1ff8c02 100644
--- a/Rx/v2/src/rxcpp/rx-observable.hpp
+++ b/Rx/v2/src/rxcpp/rx-observable.hpp
@@ -2995,47 +2995,15 @@ public:
rxo::detail::repeat<T, this_type, Count>(*this, t));
}
- /*! Infinitely retry this observable.
-
- \return An observable that mirrors the source observable, resubscribing to it if it calls on_error.
-
- \sample
- \snippet retry.cpp retry sample
- \snippet output.txt retry sample
- */
+ /*! @copydoc rx-retry.hpp
+ */
template<class... AN>
- auto retry(AN**...) const
- /// \cond SHOW_SERVICE_MEMBERS
- -> observable<T, rxo::detail::retry<T, this_type, int>>
- /// \endcond
- {
- return observable<T, rxo::detail::retry<T, this_type, int>>(
- rxo::detail::retry<T, this_type, int>(*this, 0));
- static_assert(sizeof...(AN) == 0, "retry() was passed too many arguments.");
- }
-
- /*! Retry this observable for the given number of times.
-
- \tparam Count the type of the counter
-
- \param t the number of retries
-
- \return An observable that mirrors the source observable, resubscribing to it if it calls on_error up to a specified number of retries.
-
- Call to retry(0) infinitely retries the source observable.
-
- \sample
- \snippet retry.cpp retry count sample
- \snippet output.txt retry count sample
- */
- template<class Count>
- auto retry(Count t) const
+ auto retry(AN... an) const
/// \cond SHOW_SERVICE_MEMBERS
- -> observable<T, rxo::detail::retry<T, this_type, Count>>
+ -> decltype(observable_member(retry_tag{}, *(this_type*)nullptr, std::forward<AN>(an)...))
/// \endcond
{
- return observable<T, rxo::detail::retry<T, this_type, Count>>(
- rxo::detail::retry<T, this_type, Count>(*this, t));
+ return observable_member(retry_tag{}, *this, std::forward<AN>(an)...);
}
/*! Start with the supplied values, then concatenate this observable.