-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
how to provide backpressure (lazy signal producer that fetches more data as the data is consumed) #2808
Comments
Sorry for the long delay in a response. We've been working through a lot of old issues as some contributors have dropped off. Sadly, AFAIK there's not currently a way to provide backpressure across schedulers. 😞 Do you know if any other reactive frameworks provide a way to do this? I definitely think it's an interesting concept. |
As far as I know, the frameworks from the Rx family do not generally support backpressure, but one particular implementation of streams (akka-streams) does support it: http://www.smartjava.org/content/visualizing-back-pressure-and-reactive-streams-akka-streams-statsd-grafana-and-influxdb The idea is that data flows downstream and demand flows upstream, so the recipient is always in control of the maximal incoming data rate. |
Also RxSwift does not seem to have backpressure, but it looks like their defer operator would be enough to address the same needs: http://reactivex.io/documentation/operators/defer.html How hard would it be to have such a defer operator in ReactiveCocoa? |
Not hard. I did something similar in Rex. Although, it sounds like your asking for a generalized version. Instead of a time interval for delay you would want a trigger signal/producer param to defer the subscription. |
@neilpa we would need the subscription to be deferred until the consumer has finished consuming the stream. This works well with |
I'm going to close this since your question has been answered. If you'd like to make a proposal for something, feel free to open a new issue or PR! |
I am trying to figure out how to create a
SignalProducer
that will repeatedly fetch the next chunk of data when the whole stream has been consumed.I have an implementation, however the backpressure mechanism doesn't work if
observeOn
is called on the producer. What seems to happen is that the producer continues to fetch the new data even though the client still hasn't consumed the entire stream.Any idea how I could achieve what I want? Is that actually possible?
Thanks!
The text was updated successfully, but these errors were encountered: