rpc内存池优化

This commit is contained in:
boyce
2021-01-08 11:01:09 +08:00
parent 7e288ccdd8
commit 0475edbf9e
3 changed files with 9 additions and 6 deletions

View File

@@ -1,6 +1,8 @@
package sync
import sysSync "sync"
import (
sysSync "sync"
)
type Pool struct {
C chan interface{} //最大缓存的数量
@@ -36,6 +38,7 @@ func (pool *Pool) Put(data interface{}){
default:
pool.syncPool.Put(data)
}
}
func NewPool(C chan interface{},New func()interface{}) *Pool{