neo4j-go-driver: github.com/neo4j/neo4j-go-driver/neo4j/internal/pool Index | Files

package pool

import "github.com/neo4j/neo4j-go-driver/neo4j/internal/pool"

Package pool handles the database connection pool.

Index

Package Files

errors.go pool.go server.go

type Connect Uses

type Connect func(string) (db.Connection, error)

type Pool Uses

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

func New Uses

func New(maxSize int, maxAge time.Duration, connect Connect, logger log.Logger, logId string) *Pool

func (*Pool) Borrow Uses

func (p *Pool) Borrow(ctx context.Context, serverNames []string, wait bool) (db.Connection, error)

Borrow tries to borrow an existing database connection or tries to create a new one if none exists. The wait flag indicates if the caller wants to wait for a connection to be returned if there aren't any idle connection available.

func (*Pool) CleanUp Uses

func (p *Pool) CleanUp()

Prune 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 Uses

func (p *Pool) Close()

func (*Pool) Return Uses

func (p *Pool) Return(c db.Connection)

type PoolClosed Uses

type PoolClosed struct {
}

func (*PoolClosed) Error Uses

func (e *PoolClosed) Error() string

type PoolFull Uses

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

func (*PoolFull) Error Uses

func (e *PoolFull) Error() string

type PoolTimeout Uses

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

func (*PoolTimeout) Error Uses

func (e *PoolTimeout) Error() string

Package pool imports 10 packages (graph). Updated 2020-12-25. Refresh now. Tools for package owners.