Coder Social home page Coder Social logo

Comments (4)

stakach avatar stakach commented on August 26, 2024 1

similar to my promise library too
https://github.com/spider-gazelle/promise?tab=readme-ov-file#promiseall

I'm all for this, much harder to shoot yourself in the foot and looks way better

from crystal.

ysbaddaden avatar ysbaddaden commented on August 26, 2024 1

RFC #3 had a #spawn(&) method but it looks it didn't make it to the pull request.

The .wait(&) method looks like a nice addition.

from crystal.

straight-shoota avatar straight-shoota commented on August 26, 2024

WaitGroup is a low-level primitive and IMO shouldn't need to be super polished for convenience. The idea is that most people wouldn't use it directly, in favour of a higher level concurrency API (cf. #6468). At the moment such a higher level API is still missing. But once we complete that, I suppose there would be little reason to use WaitGroup directly.

from crystal.

bararchy avatar bararchy commented on August 26, 2024

I think spawn makes sense even for a low level API?
btw, would WaitGroup work for something like

select
when bail.receive
when wg.wait
end

That would allow to make it a basis in a worker-pool implementation, or maybe even have some wg.release mechanism for when you want multiple workers to do something but first one done means we can release the others.

from crystal.

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.