Documentation ¶
Index ¶
- type MultiClient
- func (that *MultiClient) Addr() string
- func (that *MultiClient) AsyncCall(uri string, arg interface{}, result interface{}, ...) drpc.CallCmd
- func (that *MultiClient) Call(uri string, arg interface{}, result interface{}, setting ...message.MsgSetting) drpc.CallCmd
- func (that *MultiClient) Close()
- func (that *MultiClient) Endpoint() drpc.Endpoint
- func (that *MultiClient) Push(uri string, arg interface{}, setting ...message.MsgSetting) *drpc.Status
- func (that *MultiClient) Size() int
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) 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) Push ¶
func (that *MultiClient) Push(uri string, arg interface{}, setting ...message.MsgSetting) *drpc.Status
Push 发送push消息
Click to show internal directories.
Click to hide internal directories.