-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[doc] Document usage of Mono.zip() along with Mono<Void> (#3306) #3514
[doc] Document usage of Mono.zip() along with Mono<Void> (#3306) #3514
Conversation
Documented that upon supply of Mono<Void> it is not guaranteed that the resulted zipped Mono will not complete immediately upon empty completion of Mono<Void>. Fixes reactor#3306 Author: Roman Zandler <rmnzndlr@gmail.com>
I'm a bit skeptical of the use of the combinator in the examples, and especially the return of Consider the following alternative, without using
|
@chemicL , many thanks for your feedback! So, in fact, the problem lies not in the use of Void, but in the empty completion itself (and such behavior is pretty same with any type - e.g., Mono Integer as well). I will refactor then my input this weekend. |
…ers (reactor#3306) Added emphasis that the reason for the discussed behavior lies not in the use of Void, but in the empty completion itself. Fixes reactor#3306 Author: Roman Zandler <rmnzndlr@gmail.com>
@chemicL , I have committed changes in accordance with your above suggestions. Please let me know if anything else might be improved. |
docs/asciidoc/faq.adoc
Outdated
---- | ||
==== | ||
|
||
While in this case the resulting `zippedMono` does not complete immediately upon empty completion of `mono1`, such behaviour is not guaranteed for all cases. For instance, consider the following test case: |
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.
While in this case the resulting `zippedMono` does not complete immediately upon empty completion of `mono1`, such behaviour is not guaranteed for all cases. For instance, consider the following test case: | |
While in this case the resulting `zippedMono` subscribes to both `mono1` and `mono2`, such behaviour is not guaranteed for all cases. For instance, consider the following test case: |
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 think the language mentioning completing immediately is not the essence here and can be confusing. Whether it completes before or after is an implementation detail, but the user is most probably interested in the act of subscribing and processing the sources.
docs/asciidoc/faq.adoc
Outdated
} | ||
---- | ||
==== | ||
In this case upon empty completion of `mono1`, `zippedMono` completes immediately. |
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.
In this case upon empty completion of `mono1`, `zippedMono` completes immediately. | |
In this case upon empty completion of `mono1`, `zippedMono` completes immediately and does not subscribe to `mono2` and `mono3`. |
docs/asciidoc/faq.adoc
Outdated
==== | ||
In this case upon empty completion of `mono1`, `zippedMono` completes immediately. | ||
|
||
In cases where `zip` operator is used to combine empty-completed publishers, it is therefore not guaranteed that the resulting publisher will complete only upon completion of all publishers to be combined. In other words, while in some cases this behaviour might be different, it is not guaranteed that the resulting publisher will not complete immediately upon empty completion of the first publisher to be zipped. |
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.
Please consider rewriting this according to the above suggestions around subscription and not completion.
I made some more comments. Thanks for revisiting once more. I think the essence here is - completion of one source without emitting an item can influence the act of subscribing to other sources in undefined ways. It can either subscribe and cancel / discard / never subscribe. As far as I understood the risk is not subscribing to most users and the goal here is to show how to ensure subscription to all the sources. |
@chemicL , many thanks for your feedback! I will revert with revisions in the following 2 days. |
…ers (reactor#3306) Added emphasis on the act of subscribing. Fixes reactor#3306 Author: Roman Zandler <rmnzndlr@gmail.com>
@chemicL , hi! I have made some changes in accordance with your suggestions. Hopefully, now the description is clear enough. |
Documented that upon supply of Mono it is not guaranteed that the resulted zipped Mono will not complete immediately upon empty completion of Mono. Fixes #3306
Author: Roman Zandler rmnzndlr@gmail.com