异步rpc调用时,New新的输入参数传入

This commit is contained in:
boyce
2020-11-26 11:12:34 +08:00
parent 6b11bd91ec
commit f94fbe4164

View File

@@ -250,8 +250,8 @@ func (handler *RpcHandler) HandlerRpcRequest(request *RpcRequest) {
var paramList []reflect.Value
var err error
var iParam interface{}
//单协程下减少gc
if handler.IsSingleCoroutine(){
//单协程或非异步调用时直接使用预置对象
if handler.IsSingleCoroutine() && v.hasResponder==false {
iParam = v.inParam
}else{
iParam = reflect.New(v.inParamValue.Type().Elem()).Interface()