Help us shape the future of Go! Take the 2026 Go Developer Survey

hyperpool

package module
v0.0.0-...-e7bc6d5 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

README

hyperpool

a project used for reuse connections

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

type Pool struct {
	Config PoolConfig

	Close func(x interface{})
	// contains filtered or unexported fields
}

func NewPool

func NewPool(new func() interface{}, cfg ...PoolConfig) *Pool

func (*Pool) Get

func (p *Pool) Get(wait ...time.Duration) (x interface{})

func (*Pool) GetCreateConn

func (p *Pool) GetCreateConn() int32

func (*Pool) Put

func (p *Pool) Put(x interface{})

func (*Pool) Revoke

func (p *Pool) Revoke(x interface{})

type PoolConfig

type PoolConfig struct {
	// max connections limit
	MaxConn uint32
	// max reCreate connections after release
	MaxKeepConn int
	// after this time if there was no client to put connection, Pool will release the connections
	ReleaseAfter time.Duration
}

Jump to

Keyboard shortcuts

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