cpool

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

type Pool struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func New

func New(size int, ttl, cleanerInterval time.Duration, logger *logrus.Entry) *Pool

New returns a new *Pool. If size and ttl are <= 0, the Pool will panic. If cleanerInterval is <= 0, the pool cleaner won't be used.

func (*Pool) ConnRemain

func (p *Pool) ConnRemain() int

func (*Pool) Get

func (p *Pool) Get() (c net.Conn)

func (*Pool) Put

func (p *Pool) Put(c net.Conn)

Put stores c into Pool.

Jump to

Keyboard shortcuts

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