Resettable Share operator like Rxjs #2309
fedeAlterio
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Follow-up to #2297.
There are several scenarios where this issue arises:
In my view, Rx.NET does not currently provide a built-in solution that adequately handles this type of sharing. While Multicast().RefCount() comes close, it has a key limitation: once the underlying Subject completes (especially due to an error), it cannot recover.
In contrast, RxJS provides a share operator with a configuration object that allows control over reset behavior. This includes options such as:
This approach effectively addresses the limitations of Publish().RefCount() by allowing a new subject to be created after termination, rather than attempting to reuse or reset the previous one. I think this specific operator is enough, I don't see any reason to deprecate Multicast() or what not.
Rxjs reference: https://rxjs.dev/api/operators/share
A possible implementation in .NET
Beta Was this translation helpful? Give feedback.
All reactions