1.优化pending存储结构,支持超时判断

2.protobuf与json支持临时内存池
This commit is contained in:
boyce
2020-07-10 14:09:52 +08:00
parent 323e5313fb
commit c7a1d86039
4 changed files with 137 additions and 49 deletions

View File

@@ -75,12 +75,14 @@ func (agent *RpcAgent) WriteRespone(serviceMethod string,seq uint64,reply interf
var rpcResponse RpcResponse
rpcResponse.RpcResponeData = processor.MakeRpcResponse(seq,rpcError,mReply)
bytes,errM := processor.Marshal(rpcResponse.RpcResponeData)
defer processor.ReleaseRpcRespose(rpcResponse.RpcResponeData)
if errM != nil {
log.Error("service method %s %+v Marshal error:%+v!", serviceMethod,rpcResponse,errM)
return
}
processor.ReleaseRpcRespose(rpcResponse.RpcResponeData)
errM = agent.conn.WriteMsg(bytes)
if errM != nil {
log.Error("Rpc %s return is error:%+v",serviceMethod,errM)