mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-24 14:44:42 +08:00
新增rpc被调用时可以异步返回,详情请参照originserver示例
This commit is contained in:
@@ -178,7 +178,7 @@ func (client *Client) AsyncCall(rpcHandler IRpcHandler,serviceMethod string,call
|
||||
|
||||
request := &RpcRequest{}
|
||||
call.Seq = client.generateSeq()
|
||||
request.RpcRequestData = processor.MakeRpcRequest(client.startSeq,serviceMethod,false,InParam,nil)
|
||||
request.RpcRequestData = processor.MakeRpcRequest(client.startSeq,serviceMethod,false,InParam)
|
||||
client.AddPending(call)
|
||||
|
||||
bytes,err := processor.Marshal(request.RpcRequestData)
|
||||
@@ -204,7 +204,7 @@ func (client *Client) AsyncCall(rpcHandler IRpcHandler,serviceMethod string,call
|
||||
return err
|
||||
}
|
||||
|
||||
func (client *Client) RawGo(processor IRpcProcessor,noReply bool,serviceMethod string,args []byte,additionParam interface{},reply interface{}) *Call {
|
||||
func (client *Client) RawGo(processor IRpcProcessor,noReply bool,serviceMethod string,args []byte,reply interface{}) *Call {
|
||||
call := MakeCall()
|
||||
call.ServiceMethod = serviceMethod
|
||||
call.Reply = reply
|
||||
@@ -214,7 +214,7 @@ func (client *Client) RawGo(processor IRpcProcessor,noReply bool,serviceMethod s
|
||||
if noReply == false {
|
||||
client.AddPending(call)
|
||||
}
|
||||
request.RpcRequestData = processor.MakeRpcRequest(client.startSeq,serviceMethod,noReply,args,additionParam)
|
||||
request.RpcRequestData = processor.MakeRpcRequest(client.startSeq,serviceMethod,noReply,args)
|
||||
bytes,err := processor.Marshal(request.RpcRequestData)
|
||||
processor.ReleaseRpcRequest(request.RpcRequestData)
|
||||
if err != nil {
|
||||
@@ -246,7 +246,7 @@ func (client *Client) Go(noReply bool,serviceMethod string, args interface{},rep
|
||||
call.Err = err
|
||||
}
|
||||
|
||||
return client.RawGo(processor,noReply,serviceMethod,InParam,nil,reply)
|
||||
return client.RawGo(processor,noReply,serviceMethod,InParam,reply)
|
||||
}
|
||||
|
||||
func (client *Client) Run(){
|
||||
|
||||
Reference in New Issue
Block a user