Documentation ¶
Overview ¶
Package pool handles the database connection pool.
Index ¶
- Constants
- func NewServer() *server
- type Connect
- type Pool
- func (p *Pool) Borrow(ctx context.Context, getServerNames func() []string, wait bool, ...) (idb.Connection, error)
- func (p *Pool) CleanUp(ctx context.Context)
- func (p *Pool) Close(ctx context.Context)
- func (p *Pool) OnDialError(ctx context.Context, serverName string, _ error)
- func (p *Pool) OnIoError(ctx context.Context, connection idb.Connection, _ error)
- func (p *Pool) OnNeo4jError(ctx context.Context, connection idb.Connection, error *db.Neo4jError) error
- func (p *Pool) Return(ctx context.Context, c idb.Connection)
- func (p *Pool) SetRouter(router poolRouter)
Constants ¶
View Source
const DefaultConnectionLivenessCheckTimeout = math.MaxInt64
DefaultConnectionLivenessCheckTimeout disables the liveness check of connections. Liveness checks are performed before a connection is deemed idle enough to be reset.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Connect ¶
type Connect func(context.Context, string, *idb.ReAuthToken, bolt.ConnectionErrorListener, log.BoltLogger) (idb.Connection, error)
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func (*Pool) Borrow ¶
func (p *Pool) Borrow( ctx context.Context, getServerNames func() []string, wait bool, boltLogger log.BoltLogger, idlenessTimeout time.Duration, auth *idb.ReAuthToken, ) (idb.Connection, error)
func (*Pool) CleanUp ¶
CleanUp prunes all old connection on all the servers, this makes sure that servers gets removed from the map at some point in time. If there is a noticed failed connect still active we should wait a while with removal to get prioritization right.
func (*Pool) OnDialError ¶ added in v5.12.0
func (*Pool) OnNeo4jError ¶ added in v5.12.0
func (p *Pool) OnNeo4jError(ctx context.Context, connection idb.Connection, error *db.Neo4jError) error
Click to show internal directories.
Click to hide internal directories.