News for hackers. Stuff that matters.
Re:Go hits the concurrency nail on the head by hyperpape on Friday October 05, 2018 @09:24AM (#18147886)
I don't know who owns the term "futures", but the limitations of javascript promises are just choices that javascript made.

In Java, you can write:

    List<Future<String>> futures = new ArrayList<>();
    ...loop that populates futures
    List<String> strings = futures.stream().map(Future::get);
The loop will run a series of futures (potentially asynchronously...the use of a Future is decoupled from the actual choice of thread pool, etc). The map will collect the results in a blocking fashion. And Future.get() will rethrow any errors that were uncaught in the execution.

There are no comments on this comment yet.