gopkg icon indicating copy to clipboard operation
gopkg copied to clipboard

Can 'gopool' support the extended use case of 'errgroup'?

Open ryan961 opened this issue 2 years ago • 1 comments

Summary

......
// Similar:  group, ctxx := errgroup.WithCancelPool(ctx, pool) 
group, ctxx := errgroup.WithCancel(ctx) 
group.Go(func(ctxx)error)
if err := group.Wait(); err != nil { 
       return;
}
......

Motivation

gopool features (Auto-recovering Panics, Limit Goroutine Numbers, Reuse Goroutine Stack...) can make up for the lack of errgroup very well.

Explanation

No response

ryan961 avatar Jul 25 '22 08:07 ryan961

Hi, there's no plan currently, because this will greatly affect the performance, and gopool and errgroup has different design. If you need these functions, you can use errgroup in these scenes, and use gopool in other scenes.

PureWhiteWu avatar Jul 25 '22 09:07 PureWhiteWu