-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Backpressure: Publish #1732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
+1 I have especially good hopes for |
I don't think this should try to generically solve for use of Subjects, but for use of the In that case I propose we adopt a similar strategy as |
The main difficulty I see is how to manage the dynamic combining of request(n) calls of client subscribers as they may come and go at will. For example, given a multicast source, a subscriber S1 enters and calls request(10), soon after a different subscriber S2 enters and calls request(5). Since the first request started to execute, the S2 shouldn't receive more than 5 and the multicast somehow needs to buffer the remaining 5 until the subscriber S2 asks for more or S1 doesn't receive more elements until S2 asks for more. In addition, if S2 unsubscribes, S1 may now receive its remaining requested elements. |
I agree that it's a challenge. I wonder though if we can solve this in a similar way as It maintains a single buffer where it puts notifications if it can't emit and ensures it never requests more upstream than its buffer. The nuance of this is that This approach has worked well for |
After reviewing this with @neerajrj it seems to not make sense and try and make The We can achieve the multicast behavior of |
Implemented and merged in #1784 |
Is there a non-trivial or non-contrived use case for this code to help me understand its applicability? I'm having a hard time conceptualizing what it would be used for when the example can be rewritten as |
Is it possible in limited cases to support reactive pull backpressure on multicast use cases such as
.publish()
?In the general case of a
ConnectableObservable
it wouldn't be, as those are "hot". I'm interested in exploring if there are cases when it will work, such as when usingrefCount
to address use cases such as discussed in #1649 (comment)As per the example from @headinthebox
The text was updated successfully, but these errors were encountered: