mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
1.优化网络库
2.rpc协议在宕机时不会导致整个rpc无法响应
This commit is contained in:
@@ -324,7 +324,7 @@ func (server *Server) register(rcvr interface{}, name string, prefix string, use
|
||||
_, ok := server.mapCallQueue[sname]
|
||||
if ok == false {
|
||||
server.mapCallQueue[sname] = make(chan *CQueueRpcData, 10240)
|
||||
util.Go(server.ProcessQueue, sname)
|
||||
util.GoRecover(server.ProcessQueue,-1, sname)
|
||||
}
|
||||
if useName {
|
||||
sname = name
|
||||
@@ -612,7 +612,8 @@ func (server *Server) ServeCodec(codec ServerCodec) {
|
||||
wg.Add(1)
|
||||
//queueMode
|
||||
//fmt.Print(queueMode)
|
||||
go service.call(server, sending, wg, mtype, req, argv, replyv, codec)
|
||||
util.Go(service.call,server, sending, wg, mtype, req, argv, replyv, codec)
|
||||
//go service.call(server, sending, wg, mtype, req, argv, replyv, codec)
|
||||
}
|
||||
// We've seen that there are no more requests.
|
||||
// Wait for responses to be sent before closing codec.
|
||||
|
||||
Reference in New Issue
Block a user