Hacker News new | ask | show | jobs
by iheart2code 3239 days ago
This is really great. It reminds me of NSOperationQueue on iOS. I think a cool next step would be to add dependencies -- ie have Futures wait to execute until dependent Futures have completed/succeeded.
2 comments

Pretty much what jrs95 said. If I understand the question correctly, `Future.all` and `Future.race` address exactly this case.

[1] https://github.com/Mitranim/posterus#futureallvalues

[2] https://github.com/Mitranim/posterus#futureracevalues

I don't think I get what you mean exactly. How is this different from wrapping all the dependencies in a single promise and starting the dependent one when they're all finished?