go_dreamfactory/modules/battletest/call.go
2024-02-29 17:52:44 +08:00

29 lines
578 B
Go

package battletest
import (
"go_dreamfactory/lego/sys/log"
"google.golang.org/protobuf/proto"
)
//异步返回结构
type MessageCall struct {
Method string
Metadata map[string]string
ResMetadata map[string]string
Args proto.Message //请求参数
Reply proto.Message //返回参数
Error error //错误信息
Done chan *MessageCall
}
func (call *MessageCall) done(log log.Ilogf) {
select {
case call.Done <- call:
// ok
default:
log.Debugf("rpc: discarding Call reply due to insufficient Done chan capacity")
}
}