-
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
Document Mono.zip subscription scheme when Mono<Void> is supplied #3306
Comments
This fails on 3.5.0, but was passing on 3.4.6. |
@a701440 that is expected. MonoZip does not guarantee all sources are subscribed when one of the given completes or errors immediately. What you have seen in 3.4.x line was a design flaw. Consider using |
It's very confusing that the behavior is very different if you change the code to Integer.
In my actual case it was used with function.apply. When function was void it did not invoke, when function had a return value it did. |
@a701440 That is expected! As I stated above, zip is designed to join corresponding values. In case one of the sources is empty, zip unsubscribes from the other (if was subscribed before). |
what we need to document here is an alternative approach for zipping using |
Hi there! I will be glad to investigate and document this issue. Please let me know if it is still relevant. |
@RomaKudryavtsev just do it! |
@OlegDokuka , in javadoc to zip it is stated that: "An error or empty completion of any source will cause other sources to be cancelled and the resulting Mono to immediately error or complete, respectively." I believe this what you are referring to in your responses above.
Why would it pass? According to javadoc, I would say that the logic has to be as follows: mono1 completes empty, therefore zippedMono should complete immediately (i.e. without waiting for mono2). But it follows from the test case that it is quite opposite - both mono1 and mono2 are completed. Or maybe it would be proper to say that indeed .zip() simply does not guarantee that all of the publishers will be completed (meaning that in fact they might be completed). Sorry for being boring - I just want to understand the issue properly in order to add this to documentation. Also just want to note that I am using 3.5.0 version |
@RomaKudryavtsev your example is rather coincidence which happens now but in the future it may be different. The correct answer - there is no guarantee |
I updated the title of the issue to reflect the current scope of work. |
@chemicL , hi! I will do it this week - my input will be based on above reply from @OlegDokuka |
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>
@chemicL , @OlegDokuka - please let me know should you have any comments/mark-up. |
…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>
…ers (reactor#3306) Added emphasis on the act of subscribing. Fixes reactor#3306 Author: Roman Zandler <rmnzndlr@gmail.com>
) Improves the documentation to provide an explanation about subscription behaviour of the zip operator in case any provided source completes without producing items. Resolves #3306.
Thanks @RomaKudryavtsev and congrats on your first contribution! |
The test below fails when using Mono, if you slightly change the code to use Mono it passes.
3 subscribes are expected, but only one is issued.
The text was updated successfully, but these errors were encountered: