grpc_client_pool

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConnectionWaitTimeout error = errors.New("connection queue wait timeout")
)

Functions

This section is empty.

Types

type ClientCon

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

func (*ClientCon) Release

func (c *ClientCon) Release()

type ClientPool

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

func NewClientPool

func NewClientPool(config *PoolConfig) *ClientPool

func (*ClientPool) Get

func (cp *ClientPool) Get() (*ClientCon, error)

func (*ClientPool) GetNumberOfConnectionsInUse added in v0.1.3

func (cp *ClientPool) GetNumberOfConnectionsInUse() int

func (*ClientPool) GetNumberOfIdleConnections added in v0.1.3

func (cp *ClientPool) GetNumberOfIdleConnections() int

func (*ClientPool) GetNumberOfOpenConnections

func (cp *ClientPool) GetNumberOfOpenConnections() int

type PoolConfig

type PoolConfig struct {
	MaxOpenConnection     int
	MaxIdleConnection     int
	ConnectionQueueLength int
	NewClientDuration     time.Duration
	Address               string
	ConfigOptions         []grpc.DialOption
}

Jump to

Keyboard shortcuts

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