pooling

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	BindPool(pool Pool) Conn
	Close() error
	Do(doFn func(interface{}) error) error
	Recycle()
}

func NewConn

func NewConn(idle interface{}, closeFn func() error) Conn

type Pool

type Pool interface {
	Get() (conn Conn, err error)
	Put(conn Conn) error
	Remove(conn Conn) error
	Close() error
}

func NewPool

func NewPool(
	maxIdle int,
	newFn func() (Conn, error),
	testOnBorrow func(Conn, time.Time) error,
) Pool

Jump to

Keyboard shortcuts

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