Git Product home page Git Product logo

Comments (5)

addaleax avatar addaleax commented on August 22, 2024 1

Yeah, I mean, I’ve thought about adding things like support for streams or async iterators, but basically my conclusion was that if you’re using async/await, you’re already doing very fine by using something along the lines of

const results = [];
for await (const task of asyncGenerator())
  results.push(await piscina.runTask(task));

from piscina.

jasnell avatar jasnell commented on August 22, 2024 1

A lot of this can be expressed through sample code or docs. The key is just illustrating the easily copyable examples of how to do it correctly and if the pattern of doing it correctly is difficult at all, a convenience API would be helpful (The streams impl might be a good example of the latter)

from piscina.

addaleax avatar addaleax commented on August 22, 2024

I guess the question here is: Does this actually add value or make the library easier to use? for the .all/.race/.settle variants, it’s fairly straightforward to implement those using the JS built-ins, and developers are already familiar with those anyway.

from piscina.

jasnell avatar jasnell commented on August 22, 2024

These would be nice to haves as far as API is concerned. If we don't do convenience APIs for these, let's illustrate how to do it correctly in the examples.

from piscina.

jasnell avatar jasnell commented on August 22, 2024

Closing as a nothing to do here :-)

from piscina.

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.