gccp

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

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 5 Imported by: 0

README

gccp

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

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

Pool represents a pool of gRPC client connections.

func NewPool

func NewPool(address string, size int, timeout time.Duration, options ...grpc.DialOption) (*Pool, error)

NewPool creates a new pool of gRPC client connections. It initializes the pool with the given address, size, timeout, and options.

func (*Pool) Close

func (p *Pool) Close()

Close closes all connections in the pool.

func (*Pool) Get

func (p *Pool) Get() (*grpc.ClientConn, error)

Get retrieves a connection from the pool. If the pool is empty, it creates a new connection.

func (*Pool) Release

func (p *Pool) Release(conn *grpc.ClientConn)

Release returns a connection to the pool. If the connection is closed or the pool is full, it closes the connection.

Jump to

Keyboard shortcuts

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