()
| 210 | } |
| 211 | |
| 212 | func (c *PubSub) Close() error { |
| 213 | c.mu.Lock() |
| 214 | defer c.mu.Unlock() |
| 215 | |
| 216 | if c.closed { |
| 217 | return pool.ErrClosed |
| 218 | } |
| 219 | c.closed = true |
| 220 | close(c.exit) |
| 221 | |
| 222 | // Call cleanup callback if set |
| 223 | if c.onClose != nil { |
| 224 | c.onClose() |
| 225 | } |
| 226 | |
| 227 | return c.closeTheCn(pool.ErrClosed) |
| 228 | } |
| 229 | |
| 230 | // Subscribe the client to the specified channels. It returns |
| 231 | // empty subscription if there are no channels. |
nothing calls this directly
no test coverage detected