pool

package
v0.0.0-...-1cee748 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	*amqp.Connection
	// contains filtered or unexported fields
}

type ConnectionStats

type ConnectionStats struct {
	TotalCount   int
	CreatedCount int64
}

type Option

type Option func(*options)

func Context

func Context(ctx context.Context) Option

func IdleCloseTimeOut

func IdleCloseTimeOut(t int64) Option

func Logger

func Logger(logger log.Logger) Option

func MaxAlive

func MaxAlive(maxAlive int) Option

func MaxIdle

func MaxIdle(maxIdle int) Option

func MinAlive

func MinAlive(minAlive int) Option

type Pool

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

func NewPool

func NewPool(url string, opts ...Option) *Pool

func (*Pool) Acquire

func (pool *Pool) Acquire() (*Connection, error)

func (*Pool) Destroy

func (pool *Pool) Destroy(con *Connection) error

func (*Pool) Release

func (pool *Pool) Release(con *Connection) error

func (*Pool) Stats

func (pool *Pool) Stats() *ConnectionStats

Stats return stats of the pool

Jump to

Keyboard shortcuts

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