Giter Club home page Giter Club logo

Comments (1)

harendra-kumar avatar harendra-kumar commented on June 2, 2024

There a few things to take care of in the sample code above:

  1. Make the callback caller block if a queue threshold at the consumer is reached, so that the queue does not grow arbitrarily.
  2. Use atomicModifyIORef' to ensure correctness when the second stream is evaluated from concurrent threads.
  3. The callback is registered when the stream starts getting evaluated, so it may miss events from the source stream before that. That may or may not be ok depending on the use case.
  4. In general, the consumer stream needs to remove the callback from the list of callbacks when it is done, though it depends on the specific use case. For that it will have to associate some id with the callback. The IORef can keep an id counter for that and we can store a (id, callback) tuple.
  5. Exceptions in the consumer streams cannot be propagated back to the source stream.

from streamly.

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.