mirror of https://github.com/jackc/pgx.git
parent
ee2622a8e6
commit
90b69c0ee0
|
@ -72,6 +72,12 @@ func (cr *connResource) getPoolRows(c *Conn, r pgx.Rows) *poolRows {
|
||||||
|
|
||||||
// Pool allows for connection reuse.
|
// Pool allows for connection reuse.
|
||||||
type Pool struct {
|
type Pool struct {
|
||||||
|
// 64 bit fields accessed with atomics must be at beginning of struct to guarantee alignment for certain 32-bit
|
||||||
|
// architectures. See BUGS section of https://pkg.go.dev/sync/atomic and https://github.com/jackc/pgx/issues/1288.
|
||||||
|
newConnsCount int64
|
||||||
|
lifetimeDestroyCount int64
|
||||||
|
idleDestroyCount int64
|
||||||
|
|
||||||
p *puddle.Pool[*connResource]
|
p *puddle.Pool[*connResource]
|
||||||
config *Config
|
config *Config
|
||||||
beforeConnect func(context.Context, *pgx.ConnConfig) error
|
beforeConnect func(context.Context, *pgx.ConnConfig) error
|
||||||
|
@ -87,10 +93,6 @@ type Pool struct {
|
||||||
|
|
||||||
healthCheckChan chan struct{}
|
healthCheckChan chan struct{}
|
||||||
|
|
||||||
newConnsCount int64
|
|
||||||
lifetimeDestroyCount int64
|
|
||||||
idleDestroyCount int64
|
|
||||||
|
|
||||||
closeOnce sync.Once
|
closeOnce sync.Once
|
||||||
closeChan chan struct{}
|
closeChan chan struct{}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue