multiclient

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MultiClient

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

MultiClient 并发客户端,使用连接池的方式实现

func New

func New(endpoint drpc.Endpoint, addr string, maxIdleDuration time.Duration, protoFunc ...proto.ProtoFunc) *MultiClient

New 创建并发请求客户端 addr: 要请求的服务端地址 maxIdleDuration: 链接的最大闲置时间,超出该时间会自动关闭,0表示不限制,小于0表示使用后立即过期,大于0表示过期时间 protoFunc: 要使用的协议

func (*MultiClient) Addr

func (that *MultiClient) Addr() string

Addr 请求地址

func (*MultiClient) AsyncCall

func (that *MultiClient) AsyncCall(uri string, arg interface{}, result interface{}, callCmdChan chan<- drpc.CallCmd, setting ...message.MsgSetting) drpc.CallCmd

AsyncCall 异步请求

func (*MultiClient) Call

func (that *MultiClient) Call(uri string, arg interface{}, result interface{}, setting ...message.MsgSetting) drpc.CallCmd

Call 阻塞请求

func (*MultiClient) Close

func (that *MultiClient) Close()

Close 关闭客户端

func (*MultiClient) Endpoint

func (that *MultiClient) Endpoint() drpc.Endpoint

Endpoint 返回请求终端

func (*MultiClient) Push

func (that *MultiClient) Push(uri string, arg interface{}, setting ...message.MsgSetting) *drpc.Status

Push 发送push消息

func (*MultiClient) Size

func (that *MultiClient) Size() int

Size 获取当前链接数

Jump to

Keyboard shortcuts

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