Hi everyone, I’m the author of the article. Happy to answer any questions or discuss concurrency patterns in Go. Curious how others tackle such problems.
> Curious how others tackle such problems.
What do you think about the order preserving simplicity of Java?
List<Input> inputs = ...;
List<Output> results = inputs.parallelStream()
.map(this::processTask)
.collect(toList());
If you want more control or have more complex use cases, you can use an ExecutorService of your choice, handle the futures yourself or get creative with Javas new structured concurrency.
chan chan Foo seems like a cool trick, looking forward to use it in the code; thanks for the idea.
PS. I realize you present even better solution; still, first version seems like a thing nice enough to have in a toolbox