GithubHelp home page GithubHelp logo

Comments (7)

samidalouche avatar samidalouche commented on April 28, 2024 1

I don't feel comfortable enough with ReactiveSwift's codebase to put together a concrete proposal, but I can gather a summary of the different back pressure mechanisms used across the various reactive platforms so that it can serve as a a start for the discussions.

from reactiveswift.

andersio avatar andersio commented on April 28, 2024

SignalProducer?

from reactiveswift.

samidalouche avatar samidalouche commented on April 28, 2024

using stream1.concat(...) with a SignalProducer will start the SignalProducer before the client actually gets to consume the stream1 entirely, which is useless in the context of backpressure (that can be used to implement paging of infinite resources in the case of a slow consumer)

from reactiveswift.

andersio avatar andersio commented on April 28, 2024

If you don't mind, would you please provide a more concrete context or examples of the obstacles you are facing? Otherwise, it would be hard to understand what you are looking for.

Your original question on RxSwift.deferred does already have an answer: it works in a similar semantic as SignalProducer as a type. It defers the creation of the signal until it is started, and creates a signal for each start attempts, thus being called "producer".

http://reactivex.io/documentation/operators/defer.html

from reactiveswift.

samidalouche avatar samidalouche commented on April 28, 2024

Let's say that I have an HTTP API that provides a virtually unlimited amount of data through paging.

The basic use case is that I would like to provide a SignalProducer that will provide all the elements from the HTTP API. However, let's say that the consumer of the SignalProducer is much slower than the fetching of the HTTP API (and that it runs in a different scheduler). What will happen with ReactiveSwift is that an unbounded buffer of elements will accumulate until it exhausts all the memory.

What I would love to see is any way in ReactiveSwift to circumvent this issue and make the producer as slow as the consumer. Does that make sense?

from reactiveswift.

mdiep avatar mdiep commented on April 28, 2024

We don't have a plan to support defer, but I'm definitely interested in providing some back pressure mechanisms. Would you be interested in putting together a proposal or PR? That'd be the best way to move something like this forward. Or even just putting together a survey of different back pressure mechanisms used across different reactive platforms.

from reactiveswift.

RuiAAPeres avatar RuiAAPeres commented on April 28, 2024

Closing due to inactivity. If you are still interested in discussing this, please open a new Issue with your purpose (or a set of links with different approaches for the mechanism).

from reactiveswift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.