3 ms·
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 d
by iheart2code 9y 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.
- jrs95 9y agoI 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?
- Mitranim 9y agoPretty 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 https://github.com/Mitranim/posterus#futureallvalues [2] https://github.com/Mitranim/posterus#futureracevalues https://github.com/Mitranim/posterus#futureracevalues