Files
zeekay 765c3d0aa1 hanzo-ds/native: de-branded native protocol lib (fork of clickhouse ch-go v0.71.0)
Module path, package names, and identifiers de-branded to native/proto/compress/
pool/tracing. Server wire-protocol strings preserved. Vendored codec surface used
by hanzo-ds/go (proto + compress).
2026-07-10 13:10:07 -07:00

27 lines
434 B
Go

package pool
import (
"github.com/jackc/puddle/v2"
"github.com/hanzo-ds/native"
)
type connResource struct {
client *native.Client
clients []Client
}
func (cr *connResource) getConn(p *Pool, res *puddle.Resource[*connResource]) *Client {
if len(cr.clients) == 0 {
cr.clients = make([]Client, 128)
}
c := &cr.clients[len(cr.clients)-1]
cr.clients = cr.clients[0 : len(cr.clients)-1]
c.res = res
c.p = p
return c
}