-
Notifications
You must be signed in to change notification settings - Fork 402
Add rx-merge-delay-error operator #417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great! just a few more changes I think.
[state](std::exception_ptr e) { | ||
if(--state->pendingCompletions == 0) { | ||
state->out.on_error(e); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps when the last stream terminates in an error the error should be added to the composite_exception
and then the composite_exception
is sent to out.on_error
?
[state](std::exception_ptr e) { | ||
if(--state->pendingCompletions == 0) { | ||
state->out.on_error(e); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'composite_exception` again?
#else | ||
#define NOEXCEPT | ||
#endif | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be in rx-includes.hpp and should be specific to MSVC version (I know that recent versions support noexcept) and should have an unambiguous name to prevent conflicts RXCPP_NOEXCEPT
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is not required to keep the [perf] tagged tests above, since the error handling perf is not being tested.
}); | ||
auto actual = res.get_observer().messages(); | ||
REQUIRE(required == actual); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be nice to be able to check that the exception list had the correct exceptions stored.. but I think that would require a lot of work in the test infrastructure. something for the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I agree - I also spotted that the test does not cover the actual exception assertation. I'll take a look at that later
\sample | ||
\snippet merge_delay_error.cpp threaded merge sample | ||
\snippet output.txt threaded merge sample | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These examples need to be defined in a new file next to https://github.com/Reactive-Extensions/RxCpp/blob/master/Rx/v2/examples/doxygen/merge.cpp
You might want to have an example that demonstrates the composite_error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added those doxygen examples:
- https://github.com/nitrram/RxCpp/blob/merge_error_delay/Rx/v2/examples/doxygen/merge_delay_error.cpp
- https://github.com/nitrram/RxCpp/blob/merge_error_delay/Rx/v2/examples/doxygen/composite_exception.cpp
-- hopefully sufficiently enough
Yet if there is something missing, let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great! I did not see these added to https://github.com/Reactive-Extensions/RxCpp/blob/master/projects/doxygen/CMakeLists.txt
did I miss that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, my bad! I forgot that. I should also change the documentation at rx-merge_delay_error. cpp so that it matches the tests which I'm afraid does not at the moment. Unfortunately I'll be at a computer not sooner than on Sunday. But I'll fix it right then. Thanks for the review and patience
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so eventually I managed that. I added those 2 samples among the others. The documentation turned to be fine to me after all. When it's approved, shall I do something about it (squash commits...), before it gets merged?
Added RXCPP_NOEXCEPT macro; Added doxygen scenarios for composite_exception and merge_delay_error; Fixed composing exception in merge_delay_error operator; Modified test for merge_delay_operator
Thank you so much for adding the |
The operator and its test is copy-pasted and modified accordingly from
merge
It should behave the same way as JavaRx
mergeDelayError()
in the terms of semantics