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(context.Context) ([]string, error), ...) (idb.Connection, error)
- func (p *Pool) CleanUp(ctx context.Context) error
- func (p *Pool) Close(ctx context.Context) error
- func (p *Pool) Now() time.Time
- func (p *Pool) OnConnectionError(ctx context.Context, connection idb.Connection, error *db.Neo4jError) error
- func (p *Pool) Return(ctx context.Context, c idb.Connection) error
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 ¶
Types ¶
type Connect ¶
type Connect func(context.Context, string, *idb.ReAuthToken, bolt.Neo4jErrorCallback, log.BoltLogger) (idb.Connection, error)
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
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) OnConnectionError ¶
func (p *Pool) OnConnectionError(ctx context.Context, connection idb.Connection, error *db.Neo4jError) error
Click to show internal directories.
Click to hide internal directories.