deprecated_overflow_gateway.../grpc/pool.go
2017-09-11 13:42:52 +09:00

28 lines
506 B
Go

package grpc
import (
"context"
"fmt"
"git.loafle.net/commons_go/config"
cgp "git.loafle.net/commons_go/grpc_pool"
"git.loafle.net/commons_go/logging"
)
var _pool cgp.Pool
func InitializePool(ctx context.Context) {
var err error
h := &poolHandlers{
ctx: ctx,
}
h.cfg = config.Sub("grpc")
h.MaxIdle = h.cfg.GetInt("pool.MaxIdle")
h.MaxCapacity = h.cfg.GetInt("pool.MaxCapacity")
_pool, err = cgp.New(ctx, h)
if nil != err {
logging.Logger.Fatal(fmt.Sprintf("GRpc Pool: %v", err))
}
}