Revert "Revert "优化服务退出流程,增加中间件文档""

This reverts commit 64ed43b7ca.
This commit is contained in:
maxbad
2023-05-15 23:17:59 +08:00
parent 64ed43b7ca
commit 06292b603b
30 changed files with 335 additions and 97 deletions

View File

@@ -195,7 +195,9 @@ func (client *Client) connect() {
reconnect:
conn := client.dial()
if conn == nil {
client.Logger.Debugf(client.Ctx, "client dial failed")
if !client.stopFlag {
client.Logger.Debugf(client.Ctx, "client dial failed")
}
return
}
@@ -311,6 +313,11 @@ func (client *Client) Stop() {
client.Close()
}
// IsStop 是否已停止
func (client *Client) IsStop() bool {
return client.stopFlag
}
// Destroy 销毁当前连接
func (client *Client) Destroy() {
client.stopCron()