When using CollectWithErrs, I noticed that the results aren't returned in the order of invocations of .Go.
Items are added in order from the pipe
https://github.com/wandb/parallel/blob/main/collect.go#L188
And the pipe is sent to immediately when Go completes
https://github.com/wandb/parallel/blob/main/collect.go#L348
To have order, I can return an indexed struct and sort myself, but I was wondering if it would make sense to do this in the library? It seems to make the executor easier to use, especially when compared to e.g. errgroup. Otherwise, maybe the doc comment can include a note that results aren't ordered in any way?
When using
CollectWithErrs, I noticed that the results aren't returned in the order of invocations of.Go.Items are added in order from the pipe
https://github.com/wandb/parallel/blob/main/collect.go#L188
And the pipe is sent to immediately when
Gocompleteshttps://github.com/wandb/parallel/blob/main/collect.go#L348
To have order, I can return an indexed struct and sort myself, but I was wondering if it would make sense to do this in the library? It seems to make the executor easier to use, especially when compared to e.g.
errgroup. Otherwise, maybe the doc comment can include a note that results aren't ordered in any way?