gpool

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

README

gpool

go grpc connection pool

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

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

Conn 连接信息结构体

type ConnPool

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

ConnPool 连接池

func NewConnPool

func NewConnPool(cap int, serverURL string, connLifeTime time.Duration) (*ConnPool, error)

NewConnPool 创建一个连接资源池

func (*ConnPool) Close

func (cp *ConnPool) Close()

Close 关闭连接池

func (*ConnPool) Get

func (cp *ConnPool) Get() (*grpc.ClientConn, error)

Get 获取连接资源

func (*ConnPool) Put

func (cp *ConnPool) Put(conn *grpc.ClientConn) error

Put 连接资源放回池中

Jump to

Keyboard shortcuts

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