Closed caevv closed 2 years ago
Hey @caevv, pond doesn't support that pattern at the moment, but it might be a good addition
@alitto @caevv how golang can stop goroutines from another? We can not do it. I think it is popular to stop submit similar task to group of workers when an error from a worker which is running kind of this task
You stop accepting new tasks. Check example usage here: https://cs.opensource.google/go/x/sync/+/036812b2:errgroup/errgroup.go
Hey @caevv,
I just released v1.8.0 of pond and added a new API to support a functionality similar to what errgroup provides. Please check it out at https://github.com/alitto/pond#submitting-a-group-of-tasks-associated-to-a-context-since-v180 and let me know your thoughts.
As soon as one of the tasks returns a non-nil error, the remaining tasks are cancelled and never started. Also, a context.Context
can be specified to allow cancelation of tasks.
Any way to submit a task and when an error happens, stop other workers? Kind of like errgroup.