Merge remote-tracking branch 'origin/master'

This commit is contained in:
geek 2017-08-24 15:06:13 +09:00
commit a7ea0ee3c3
2 changed files with 5 additions and 0 deletions

View File

@ -17,6 +17,8 @@ func main() {
s := server.New()
grpcPool, err := backend.NewPool(backend.Options{
InitCapacity: 2,
MaxCapacity: 4,
Dial: func() (*grpc.ClientConn, error) {
return grpc.Dial("192.168.1.101:50006", grpc.WithInsecure())
},

View File

@ -12,12 +12,15 @@ import (
func SignIn(sctx *server.ServerContext, ctx *fasthttp.RequestCtx) {
grpcPool := sctx.Value("grpc").(backend.Pool)
fmt.Fprintf(ctx, "avail: %d\n", grpcPool.Available())
c, err := grpcPool.Get()
if nil != err {
}
defer c.Close()
fmt.Fprintf(ctx, "avail: %d\n", grpcPool.Available())
signinId := string(ctx.FormValue("signinId"))
signinPw := string(ctx.FormValue("signinPw"))