diff options
Diffstat (limited to 'Rx')
-rw-r--r-- | Rx/v2/src/rxcpp/operators/rx-retry.hpp | 3 | ||||
-rw-r--r-- | Rx/v2/test/operators/retry.cpp | 6 |
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(); }); |