pool

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 4 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMaxConn = fmt.Errorf("maximum connections reached")

Functions

This section is empty.

Types

type ConnPool

type ConnPool struct {
	sync.RWMutex

	Name     string
	Address  string
	MaxConns int
	MaxIdle  int
	Cnt      int64
	New      func(name string) (NConn, error)
	// contains filtered or unexported fields
}

func NewConnPool

func NewConnPool(name string, address string, maxConns int, maxIdle int) *ConnPool

func (*ConnPool) Fetch

func (this *ConnPool) Fetch() (NConn, error)

func (*ConnPool) ForceClose

func (this *ConnPool) ForceClose(conn NConn)

func (*ConnPool) Proc

func (this *ConnPool) Proc() string

func (*ConnPool) Release

func (this *ConnPool) Release(conn NConn)

type NConn

type NConn interface {
	io.Closer
	Name() string
	Closed() bool
}

Jump to

Keyboard shortcuts

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