Skip to content

Conversation

nitrram
Copy link
Contributor

@nitrram nitrram commented Dec 6, 2017

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

@msftclas
Copy link

msftclas commented Dec 6, 2017

CLA assistant check
All CLA requirements met.

Copy link
Member

@kirkshoop kirkshoop left a 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 {
Copy link
Member

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 {
Copy link
Member

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

Copy link
Member

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

}
}
}

Copy link
Member

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);
}
Copy link
Member

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.

Copy link
Contributor Author

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
*/
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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?

Martin Kodovský added 3 commits December 7, 2017 00:21
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
@kirkshoop kirkshoop merged commit 815e921 into ReactiveX:master Dec 9, 2017
@kirkshoop
Copy link
Member

Thank you so much for adding the merge_delay_error() operator!

@nitrram nitrram deleted the merge_error_delay branch December 14, 2017 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants