-
Notifications
You must be signed in to change notification settings - Fork 38.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve fix of duplicate upstream subscription during reactive cache put
This commit fixes an issue where a Cacheable method which returns a Flux (or multi-value publisher) will be invoked once, but the returned publisher is actually subscribed twice. The previous fix 988f363 would cause the cached elements to depend on the first usage pattern / request pattern, which is likely to be too confusing to users. This fix reintroduces the notion of exhausting the original Flux by having a second subscriber dedicated to that, but uses `refCount(2)` to ensure that the original `Flux` returned by the cached method is still only subscribed once. Closes gh-32370
- Loading branch information
1 parent
c1d4b61
commit 6d9a2eb
Showing
3 changed files
with
73 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters