Andy Pan

Results 174 comments of Andy Pan

请升级到最新的 v2.5.0,看看是否解决,我记得后来的新版本应该修复了这种问题。

你可以用 NewPool(-1),设置 pool 的容量不限制,试试能不能解决。

pool 满了在 ```go if w = p.retrieveWorker(ctx); w == nil { return ErrPoolOverload } ``` 这一步就阻塞住了,所以无法通过你说的方式解决,你可以将 pool 设置成非阻塞的,这样 pool 满了就能直接返回错误了。

这里都是在同一个 package 里,没有什么循环引用。

主要是有一些不兼容的更新,还有后面有一些新的 API 和优化。

Why do we need this? Moreover, using `any` makes `ants` incompatible with the go versions before 1.18.

I believe that this job could be easily done via a local map whose key is uid.

Sorry, but I prefer to keep `ants` simple and only add those essential features to it.

https://pkg.go.dev/github.com/panjf2000/ants/v2#Pool.Running https://pkg.go.dev/github.com/panjf2000/ants/v2#Pool.Waiting