summaryrefslogtreecommitdiff
path: root/Rx
diff options
context:
space:
mode:
authorelelel <elel@3wh.net>2017-02-24 15:15:10 +0000
committerKirk Shoop <kirk.shoop@microsoft.com>2017-02-24 07:15:10 -0800
commit850e7da2231142c1613d60f4b571885885c8154e (patch)
treec53e7f90b9aa0486e94effd153a6522d11d44390 /Rx
parent570d2d422a5dfae2631cdf96f51eace7c2f7b462 (diff)
downloadRxCpp-850e7da2231142c1613d60f4b571885885c8154e.tar.gz
Retry operator argument semantics fix (#362)
* Fix retry operator's argument semantics * Rephrase comments in tries parameter desc
Diffstat (limited to 'Rx')
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-retry.hpp3
-rw-r--r--Rx/v2/test/operators/retry.cpp6
2 files changed, 4 insertions, 5 deletions
diff --git a/Rx/v2/src/rxcpp/operators/rx-retry.hpp b/Rx/v2/src/rxcpp/operators/rx-retry.hpp
index f71bae2..073aa6c 100644
--- a/Rx/v2/src/rxcpp/operators/rx-retry.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-retry.hpp
@@ -8,7 +8,7 @@
\tparam Count the type of the counter (optional)
- \param t the number of retries (optional) If not specified, infinitely retries the source observable. Specifying returns immediately without subscribing
+ \param t the total number of tries (optional), i.e. retry(2) means one normal try, before an error occurs, and one retry. If not specified, infinitely retries the source observable. Specifying 0 returns immediately without subscribing
\return An observable that mirrors the source observable, resubscribing to it if it calls on_error up to a specified number of retries.
@@ -100,7 +100,6 @@ namespace retry {
struct values {
values(source_type s, count_type t)
: source(std::move(s)), remaining_(std::move(t)) {
- if (remaining_ != 0) ++remaining_;
}
inline bool completed_predicate() const {
diff --git a/Rx/v2/test/operators/retry.cpp b/Rx/v2/test/operators/retry.cpp
index 92c117f..c3d2aa6 100644
--- a/Rx/v2/test/operators/retry.cpp
+++ b/Rx/v2/test/operators/retry.cpp
@@ -119,7 +119,7 @@ SCENARIO("retry 0, basic test", "[retry][operators]") {
SCENARIO("retry with failure", "[retry][operators]") {
- GIVEN("hot observable of 3x4x7 ints with errors inbetween the groups. Retry 1. Must fail.") {
+ GIVEN("hot observable of 3x4x7 ints with errors inbetween the groups. Retry 2. Must fail.") {
auto sc = rxsc::make_test();
auto w = sc.create_worker();
const rxsc::test::messages<int> on;
@@ -145,12 +145,12 @@ SCENARIO("retry with failure", "[retry][operators]") {
on.completed(725)
});
- WHEN("retry of 1 is launched with expected error before complete") {
+ WHEN("retry of 2 is launched with expected error before complete") {
auto res = w.start(
[&]() {
return xs
- .retry(1)
+ .retry(2)
// forget type to workaround lambda deduction bug on msvc 2013
.as_dynamic();
});