You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently, I was using Mono.cache() and thought that it did not provide concurrency guarantees.
That is, I understood that once the result is computed, it would not be re-computed. But, I wondered what would happen before the result was cached. Would two concurrent subscriptions result in two separate computations?
Improvement Suggestion
@simonbasle explained to me that Mono.cache() does indeed ensure that concurrent subscriptions will not result in multiple computations:
it will prevent concurrent subscriptions from triggering 2 upstream subscriptions to the source, ie prevent double computation if the source only computes in response to a subscription (which it should)
I think something similar to @simonbasle's explanation would be a nice addition to Mono.cache()'s JavaDoc.
The text was updated successfully, but these errors were encountered:
This commit polishes the javadoc of most cache variants in Mono:
- explicit the behavior in case of concurrent subscriptions for
`cache()`, `cache(Duration)` and `cache(Function)`
- polish (un)ordered lists and paragraph breaks in `cacheInvalidateIf`
and `cacheInvalidateWhen` javadoc.
Fixes#2782.
This commit polishes the javadoc of most cache variants in Mono:
- explicit the behavior in case of concurrent subscriptions for
`cache()`, `cache(Duration)` and `cache(Function)`
- polish (un)ordered lists and paragraph breaks in `cacheInvalidateIf`
and `cacheInvalidateWhen` javadoc.
Fixes#2782.
Documentation Issue
Recently, I was using
Mono.cache()
and thought that it did not provide concurrency guarantees.That is, I understood that once the result is computed, it would not be re-computed. But, I wondered what would happen before the result was cached. Would two concurrent subscriptions result in two separate computations?
Improvement Suggestion
@simonbasle explained to me that
Mono.cache()
does indeed ensure that concurrent subscriptions will not result in multiple computations:I think something similar to @simonbasle's explanation would be a nice addition to
Mono.cache()
's JavaDoc.The text was updated successfully, but these errors were encountered: