A method of PubSub that updates the chat room by subscribing to the new topic
()
| 304 | // A method of PubSub that updates the chat |
| 305 | // room by subscribing to the new topic |
| 306 | func (cr *PubSub) Exit() { |
| 307 | defer cr.pscancel() |
| 308 | |
| 309 | // Cancel the existing subscription |
| 310 | cr.psub.Cancel() |
| 311 | // Close the topic handler |
| 312 | cr.pstopic.Close() |
| 313 | } |
| 314 | |
| 315 | // A method of PubSub that updates the chat user name |
| 316 | func (cr *PubSub) UpdateUser(username string) { |