koding / kite

Micro-service framework in Go
https://godoc.org/github.com/koding/kite
MIT License
3.26k stars 300 forks source link

Does kite have its own client connection pool? Need to implement it myself? Is there a simple demo? #226

Open aapelismith opened 5 years ago

aapelismith commented 5 years ago

Does kite have its own client connection pool? Need to implement it myself? Is there a simple demo?

var captchaPoll *sync.Pool = &sync.Pool{
    New: func() interface{} {
        k := ku.NewClient("http://localhost:3636/kite")
        k.Dial()
        return k
    },
}
aapelismith commented 5 years ago

This is my own connection pool. He is so simple and clumsy. I want to know if there is any best way to implement this connection pool.

package main
import (
    "github.com/koding/kite"
    "sync"
)
var userSrvPoll *sync.Pool = &sync.Pool{
    New: func() interface{} {
        k := k.NewClient("http://localhost:3636/kite")
        k.Dial()
        return k
    },
}