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) 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.
Click to show internal directories.
Click to hide internal directories.