pool

package
v5.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package pool handles the database connection pool.

Index

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

func NewServer

func NewServer() *server

Types

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

func New

func New(config *config.Config, connect Connect, logger log.Logger, logId string) *Pool

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

func (p *Pool) CleanUp(ctx context.Context)

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) Close

func (p *Pool) Close(ctx context.Context)

func (*Pool) OnDialError added in v5.12.0

func (p *Pool) OnDialError(ctx context.Context, serverName string, _ error)

func (*Pool) OnIoError added in v5.12.0

func (p *Pool) OnIoError(ctx context.Context, connection idb.Connection, _ error)

func (*Pool) OnNeo4jError added in v5.12.0

func (p *Pool) OnNeo4jError(ctx context.Context, connection idb.Connection, error *db.Neo4jError) error

func (*Pool) Return

func (p *Pool) Return(ctx context.Context, c idb.Connection)

func (*Pool) SetRouter added in v5.12.0

func (p *Pool) SetRouter(router poolRouter)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL