pool

package
v5.9.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2018 License: GPL-3.0 Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPoolIsFull = errors.New("pool is full")

Functions

This section is empty.

Types

type Config

type Config struct {
	Size              int
	MaxIdleTime       time.Duration
	KeepAliveInterval time.Duration

	NewConnFunc   func() (IConn, error)
	KeepAliveFunc func(conn IConn) error
}

type IConn

type IConn interface {
	Free()
}

type Pool

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

func NewPool

func NewPool(config *Config) *Pool

func (*Pool) Get

func (this *Pool) Get() (IConn, error)

func (*Pool) Put

func (this *Pool) Put(conn IConn) error

Jump to

Keyboard shortcuts

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