pool
Usage
package main
import(
"net"
"github.com/djherbis/pool"
)
func main() {
p := NewPool(func() (net.Conn, error) {
return net.Dial("tcp", "localhost:10000")
})
if c, err := p.Get(); err == nil {
c.Write([]byte("hello world\n"))
c.Close()
}
}
Installation
go get github.com/djherbis/pool