mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
优化rpc超时-使用时间轮定时器
This commit is contained in:
@@ -43,7 +43,7 @@ func init(){
|
||||
}
|
||||
|
||||
func (jsonProcessor *JsonProcessor) Marshal(v interface{}) ([]byte, error){
|
||||
return jsonProcessor.Marshal(v)
|
||||
return json.Marshal(v)
|
||||
}
|
||||
|
||||
func (jsonProcessor *JsonProcessor) Unmarshal(data []byte, v interface{}) error{
|
||||
@@ -65,6 +65,7 @@ func (jsonProcessor *JsonProcessor) MakeRpcResponse(seq uint64,err *RpcError,rep
|
||||
jsonRpcResponseData.Seq = seq
|
||||
jsonRpcResponseData.Err = err.Error()
|
||||
jsonRpcResponseData.Reply = reply
|
||||
|
||||
return jsonRpcResponseData
|
||||
}
|
||||
|
||||
@@ -72,8 +73,8 @@ func (jsonProcessor *JsonProcessor) ReleaseRpcRequest(rpcRequestData IRpcRequest
|
||||
rpcJsonRequestDataPool.Put(rpcRequestData)
|
||||
}
|
||||
|
||||
func (jsonProcessor *JsonProcessor) ReleaseRpcRespose(rpcRequestData IRpcResponseData){
|
||||
rpcJsonResponseDataPool.Put(rpcRequestData)
|
||||
func (jsonProcessor *JsonProcessor) ReleaseRpcResponse(rpcResponseData IRpcResponseData){
|
||||
rpcJsonResponseDataPool.Put(rpcResponseData)
|
||||
}
|
||||
|
||||
func (jsonProcessor *JsonProcessor) IsParse(param interface{}) bool {
|
||||
|
||||
Reference in New Issue
Block a user