Add timeout with fallback observable#302
Conversation
Codecov Report
@@ Coverage Diff @@
## main #302 +/- ##
=======================================
Coverage 98.26% 98.27%
=======================================
Files 109 109
Lines 1556 1562 +6
=======================================
+ Hits 1529 1535 +6
Misses 27 27
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
BENCHMARK RESULTS (AUTOGENERATED)ci-macosObservable constructionTable
Observable liftTable
Observable subscribeTable
Observable subscribe #2Table
Observer constructionTable
OnNextTable
Subscriber constructionTable
SubscriptionTable
bufferTable
chains creation testTable
combine_latestTable
concatTable
distinct_until_changedTable
firstTable
foundamental sourcesTable
fromTable
immediate schedulerTable
justTable
lastTable
mapTable
mergeTable
observe_onTable
on_error_resume_nextTable
publish_subject callbacksTable
publish_subject routinesTable
repeatTable
scanTable
single-threaded locksTable
skipTable
switch_on_nextTable
takeTable
take_lastTable
take_untilTable
timeoutTable
trampoline schedulerTable
windowTable
with_latest_fromTable
ci-ubuntu-clangObservable constructionTable
Observable liftTable
Observable subscribeTable
Observable subscribe #2Table
Observer constructionTable
OnNextTable
Subscriber constructionTable
SubscriptionTable
bufferTable
chains creation testTable
combine_latestTable
concatTable
distinct_until_changedTable
firstTable
foundamental sourcesTable
fromTable
immediate schedulerTable
justTable
lastTable
mapTable
mergeTable
observe_onTable
on_error_resume_nextTable
publish_subject callbacksTable
publish_subject routinesTable
repeatTable
scanTable
single-threaded locksTable
skipTable
switch_on_nextTable
takeTable
take_lastTable
take_untilTable
timeoutTable
trampoline schedulerTable
windowTable
with_latest_fromTable
ci-ubuntu-gccObservable constructionTable
Observable liftTable
Observable subscribeTable
Observable subscribe #2Table
Observer constructionTable
OnNextTable
Subscriber constructionTable
SubscriptionTable
bufferTable
chains creation testTable
combine_latestTable
concatTable
distinct_until_changedTable
firstTable
foundamental sourcesTable
fromTable
immediate schedulerTable
justTable
lastTable
mapTable
mergeTable
observe_onTable
on_error_resume_nextTable
publish_subject callbacksTable
publish_subject routinesTable
repeatTable
scanTable
single-threaded locksTable
skipTable
switch_on_nextTable
takeTable
take_lastTable
take_untilTable
timeoutTable
trampoline schedulerTable
windowTable
with_latest_fromTable
ci-windowsObservable constructionTable
Observable liftTable
Observable subscribeTable
Observable subscribe #2Table
Observer constructionTable
OnNextTable
Subscriber constructionTable
SubscriptionTable
bufferTable
chains creation testTable
combine_latestTable
concatTable
distinct_until_changedTable
firstTable
foundamental sourcesTable
fromTable
immediate schedulerTable
justTable
lastTable
mapTable
mergeTable
observe_onTable
on_error_resume_nextTable
publish_subject callbacksTable
publish_subject routinesTable
repeatTable
scanTable
single-threaded locksTable
skipTable
switch_on_nextTable
takeTable
take_lastTable
take_untilTable
timeoutTable
trampoline schedulerTable
windowTable
with_latest_fromTable
|
| for (int i = 0; i < 10; ++i) | ||
| try | ||
| { | ||
| std::rethrow_exception(err); |
There was a problem hiding this comment.
parameter err is passed by value and only copied once; consider moving it to avoid unnecessary copies
| std::rethrow_exception(err); | |
| std::rethrow_exception(std::move(err); |
| for (int i = 0; i < 10; ++i) | ||
| try | ||
| { | ||
| std::rethrow_exception(err); |
There was a problem hiding this comment.
parameter err is passed by value and only copied once; consider moving it to avoid unnecessary copies
| std::rethrow_exception(err); | |
| std::rethrow_exception(err)); |
| namespace rpp::details | ||
| { | ||
| template<constraint::decayed_type Type, schedulers::constraint::scheduler TScheduler> | ||
| template<constraint::decayed_type Type, constraint::observable_of_type<Type> FallbackObs, schedulers::constraint::scheduler TScheduler> |
There was a problem hiding this comment.
no template named observable_of_type in namespace rpp::constraint; did you mean observer_of_type?
| template<constraint::decayed_type Type, constraint::observable_of_type<Type> FallbackObs, schedulers::constraint::scheduler TScheduler> | |
| template<constraint::decayed_type Type, constraint::observer_of_type<Type> FallbackObs, schedulers::constraint::scheduler TScheduler> |
| * \ingroup utility_operators | ||
| * \see https://reactivex.io/documentation/operators/timeout.html | ||
| */ | ||
| template<constraint::observable_of_type<Type> FallbackObs, schedulers::constraint::scheduler TScheduler> |
There was a problem hiding this comment.
no template named observable_of_type in namespace rpp::constraint; did you mean observer_of_type?
| template<constraint::observable_of_type<Type> FallbackObs, schedulers::constraint::scheduler TScheduler> | |
| template<constraint::observer_of_type<Type> FallbackObs, schedulers::constraint::scheduler TScheduler> |
| return static_cast<const SpecificObservable*>(this)->template lift<Type>(timeout_impl<Type, std::decay_t<FallbackObs>, TScheduler>{period, std::forward<FallbackObs>(fallback_obs), scheduler}); | ||
| } | ||
|
|
||
| template<constraint::observable_of_type<Type> FallbackObs,schedulers::constraint::scheduler TScheduler> |
There was a problem hiding this comment.
no template named observable_of_type in namespace rpp::constraint; did you mean observer_of_type?
| template<constraint::observable_of_type<Type> FallbackObs,schedulers::constraint::scheduler TScheduler> | |
| template<constraint::observer_of_type<Type> FallbackObs,schedulers::constraint::scheduler TScheduler> |
| auto timeout(schedulers::duration period, const TScheduler& scheduler = TScheduler{}) const & requires is_header_included<timeout_tag, TScheduler> | ||
| { | ||
| return static_cast<const SpecificObservable*>(this)->template lift<Type>(timeout_impl<Type, TScheduler>{period, scheduler}); | ||
| return timeout(period, rpp::source::error<Type>(std::make_exception_ptr(utils::timeout{"Timeout reached"})), scheduler); |
There was a problem hiding this comment.
no member named timeout in namespace rpp::utils
| auto timeout(schedulers::duration period, const TScheduler& scheduler = TScheduler{}) && requires is_header_included<timeout_tag, TScheduler> | ||
| { | ||
| return std::move(*static_cast<SpecificObservable*>(this)).template lift<Type>(timeout_impl<Type, TScheduler>{period, scheduler}); | ||
| return std::move(*static_cast<SpecificObservable*>(this)).timeout(period, rpp::source::error<Type>(std::make_exception_ptr(utils::timeout{"Timeout reached"})), scheduler); |
There was a problem hiding this comment.
no member named timeout in namespace rpp::utils
|
Kudos, SonarCloud Quality Gate passed! |








#295