mirror of
https://github.com/redis/go-redis.git
synced 2025-04-19 07:22:17 +03:00
Reuse write buffer.
This commit is contained in:
parent
aff229a228
commit
97039c229c
2
pool.go
2
pool.go
@ -35,6 +35,7 @@ type pool interface {
|
||||
type conn struct {
|
||||
netcn net.Conn
|
||||
rd *bufio.Reader
|
||||
buf []byte
|
||||
|
||||
inUse bool
|
||||
usedAt time.Time
|
||||
@ -53,6 +54,7 @@ func newConnFunc(dial func() (net.Conn, error)) func() (*conn, error) {
|
||||
}
|
||||
cn := &conn{
|
||||
netcn: netcn,
|
||||
buf: make([]byte, 0, 64),
|
||||
}
|
||||
cn.rd = bufio.NewReader(cn)
|
||||
return cn, nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user