deprecated_overflow_gateway.../grpc/pool.go

27 lines
499 B
Go
Raw Normal View History

2017-09-11 02:24:18 +00:00
package grpc
import (
"context"
"fmt"
cgp "git.loafle.net/commons_go/grpc_pool"
"git.loafle.net/commons_go/logging"
2017-09-19 08:38:59 +00:00
"git.loafle.net/overflow/overflow_gateway_probe/conf"
2017-09-11 02:24:18 +00:00
)
var _pool cgp.Pool
func InitializePool(ctx context.Context) {
var err error
h := &poolHandlers{
2017-09-11 04:42:52 +00:00
ctx: ctx,
2017-09-11 02:24:18 +00:00
}
2017-09-19 08:38:59 +00:00
h.MaxIdle = conf.Config.GRPC.Pool.MaxIdle
h.MaxCapacity = conf.Config.GRPC.Pool.MaxCapacity
2017-09-11 02:24:18 +00:00
_pool, err = cgp.New(ctx, h)
if nil != err {
2017-09-11 04:42:52 +00:00
logging.Logger.Fatal(fmt.Sprintf("GRpc Pool: %v", err))
2017-09-11 02:24:18 +00:00
}
}