ing
This commit is contained in:
parent
5957c701f9
commit
6e59e6b669
|
@ -39,6 +39,8 @@ type rpcServlet struct {
|
||||||
|
|
||||||
stopChan chan struct{}
|
stopChan chan struct{}
|
||||||
stopWg sync.WaitGroup
|
stopWg sync.WaitGroup
|
||||||
|
|
||||||
|
sendMtx sync.RWMutex
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *rpcServlet) Context() ServletContext {
|
func (s *rpcServlet) Context() ServletContext {
|
||||||
|
@ -83,6 +85,7 @@ func (s *rpcServlet) Start(parentCTX cuc.Context, conn interface{}, doneChan cha
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *rpcServlet) Send(method string, args ...interface{}) (err error) {
|
func (s *rpcServlet) Send(method string, args ...interface{}) (err error) {
|
||||||
|
s.sendMtx.RLock()
|
||||||
noti := ¬ification{
|
noti := ¬ification{
|
||||||
method: method,
|
method: method,
|
||||||
args: args,
|
args: args,
|
||||||
|
@ -92,7 +95,7 @@ func (s *rpcServlet) Send(method string, args ...interface{}) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
s.responseQueueChan <- rs
|
s.responseQueueChan <- rs
|
||||||
|
s.sendMtx.RUnlock()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user