pool

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	Conn *grpc.ClientConn
	// contains filtered or unexported fields
}

Conn is a single connection to pool wrapper

func (Conn) Close

func (p Conn) Close() error

Close connection

type Factory

type Factory func() (*grpc.ClientConn, error)

Factory is a connection pool factory fun interface

type Pool

type Pool interface {
	Get() (Conn, error)
	Close()
	Available() int
	Busy() int
}

Pool represents connection pool

func NewChannelPool

func NewChannelPool(initialCap, maxCap int, factory Factory) (Pool, error)

NewChannelPool builds a new pool with provided configuration

Jump to

Keyboard shortcuts

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