Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Single.concat(Publisher)
defer subscribe to Publisher
until reque…
…sted (#1643) Motivation: Current version of `Single.concat(Publisher)` subscribes to the next `Publisher` as soon as the `Single` completes. If the passed `Publisher` does not support multiple subscribes, users can not apply retries if the further processing of the single result fails. Modifications: - Add `Single.concat(Publisher, boolean)` overload that tells if we need to subscribe to the next `Publisher` asap or defer subscribe until more items are requested; - Implement another `ConcatDeferNextSubscriber` variant that defers subscribe to the next publisher, share common code in `AbstractConcatSubscriber`; - Enhance tests for new operator variant; Result: If processing of the first item failed and no more items were requested, it's safe to apply retry operator even with a `Publisher` that do not support re-subscribe.
- Loading branch information