pool
pool copied to clipboard
General Purpose Connection Pool for GRPC,RPC,TCP Sevice Cluster
**Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd...
`p, err := pool.NewTCPPool(options) //for tcp ` example using NewTCPPool causes error :- `2020/07/08 10:43:01 &net.OpError{Op:"dial", Net:"tcp", Source:net.Addr(nil), Addr:(*net.TCPAddr)(0xc0002026c0), Err:(*os.SyscallError)(0xc000208180)}`
1. 当初始化的链接都超过了空闲时间,当 `pool.Get` 时,会重新创建一个链接并返回。 针对这个问题,新增了一个方法,在 `NewGRPCPool` 方法中调用,每隔 10s 中,维护一下连接池数量。 ``` //check connection count go pool.CheckGRPCPool() ``` 2. 当初始化的链接数超过 MaxCap,比如做压测的时候。 针对这个问题,新增了一个判断,当 `c.IdleCount() >= MaxCap` 时,会返回一个 Error。 3. 当 `pool.Get` 时,新增一个判断: ```...
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.19.0 to 1.53.0. Release notes Sourced from google.golang.org/grpc's releases. Release 1.53.0 API Changes balancer: support injection of per-call metadata from LB policies (#5853) resolver: remove deprecated field...
``` go get -u gopkg.in/flyaways/pool.v1 go: gopkg.in/flyaways/[email protected]: invalid version: go.mod has non-....v1 module path "github.com/flyaways/pool" at revision v1.0.1 ```