diff --git a/docs/asciidoc/faq.adoc b/docs/asciidoc/faq.adoc index 6702ca161f..a62413ad66 100644 --- a/docs/asciidoc/faq.adoc +++ b/docs/asciidoc/faq.adoc @@ -160,7 +160,7 @@ myMethod.emptySequenceForKey("a") // this method returns empty Mono [[faq.monoZipEmptyCompletion]] == Using `zip` along with empty-completed publishers -When using the `zip` operator along with empty-completed publishers, it is important to be aware of the following behavior. +When using the `zip` operator along with empty-completed publishers (i.e., publishers completing without emitting an item), it is important to be aware of the following behavior. Consider the following test case: @@ -185,7 +185,7 @@ Consider the following test case: ---- ==== -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: ==== [source,java] @@ -211,11 +211,11 @@ While in this case the resulting `zippedMono` does not complete immediately upon } ---- ==== -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`. -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. +Therefore, in cases where `zip` operator is used to combine empty-completed publishers, it is not guaranteed that the resulting publisher will subscribe to all the empty-completed publishers. -If it is necessary to keep the semantics as shown in the second test case, consider using `singleOptional` operator, as demonstrated in the test case below: +If it is necessary to keep the semantics as shown in the second test case and to ensure subscription to all the publishers to be zipped, consider using `singleOptional` operator, as demonstrated in the test case below: ==== [source,java]