(err StopError)
| 99 | } |
| 100 | |
| 101 | func (i *IO) close(err StopError) bool { |
| 102 | if i.IsClosed() { |
| 103 | i.Debug("already closed", err...) |
| 104 | return false |
| 105 | } |
| 106 | i.Info("close", err...) |
| 107 | if i.CancelCauseFunc != nil { |
| 108 | i.CancelCauseFunc(err) |
| 109 | } |
| 110 | if i.Closer != nil { |
| 111 | i.Closer.Close() |
| 112 | } |
| 113 | return true |
| 114 | } |
| 115 | |
| 116 | // Stop 停止订阅或者发布,由订阅者或者发布者调用 |
| 117 | func (io *IO) Stop(reason ...zapcore.Field) { |