pool

package
v5.8.1-10 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package pool handles the database connection pool.

Index

Constants

View Source
const DefaultLivenessCheckThreshold = math.MaxInt64

DefaultLivenessCheckThreshold 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, now *func() time.Time) *Pool

func (*Pool) Borrow

func (p *Pool) Borrow(ctx context.Context, getServerNames func(context.Context) ([]string, error), wait bool, boltLogger log.BoltLogger, idlenessThreshold time.Duration, auth *idb.ReAuthToken) (idb.Connection, error)

func (*Pool) CleanUp

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

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

func (*Pool) Now

func (p *Pool) Now() time.Time

func (*Pool) OnConnectionError

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

func (*Pool) Return

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

Jump to

Keyboard shortcuts

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