mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
增加异步Responder有效性判断接口
This commit is contained in:
@@ -25,6 +25,10 @@ type RpcResponse struct {
|
||||
|
||||
type Responder = RequestHandler
|
||||
|
||||
func (r *Responder) IsInvalid() bool {
|
||||
return reflect.ValueOf(*r).Pointer() == reflect.ValueOf(reqHandlerNull).Pointer()
|
||||
}
|
||||
|
||||
//var rpcResponsePool sync.Pool
|
||||
var rpcRequestPool sync.Pool
|
||||
var rpcCallPool sync.Pool
|
||||
|
||||
@@ -253,7 +253,7 @@ func (handler *RpcHandler) HandlerRpcRequest(request *RpcRequest) {
|
||||
//单协程或非异步调用时直接使用预置对象
|
||||
if handler.IsSingleCoroutine() && v.hasResponder==false {
|
||||
iParam = v.inParam
|
||||
}else{
|
||||
}else if v.inParam != nil {
|
||||
iParam = reflect.New(v.inParamValue.Type().Elem()).Interface()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user