增加rpc client状态判断

This commit is contained in:
boyce
2019-04-20 11:51:02 +08:00
parent 49545403b1
commit a900f32730
2 changed files with 30 additions and 9 deletions

View File

@@ -70,6 +70,12 @@ type ClientCodec interface {
Close() error
}
func (client *Client) IsClosed() bool {
client.reqMutex.Lock()
defer client.reqMutex.Unlock()
return client.shutdown || client.closing
}
func (client *Client) send(call *Call, queueMode bool) {
client.reqMutex.Lock()
defer client.reqMutex.Unlock()