Browse Source

TODO: add code comments [FUTURE]

Volodymyr Tkach 2 years ago
parent
commit
c06d1db80c
1 changed files with 6 additions and 0 deletions
  1. 6 0
      pubsub/connection.go

+ 6 - 0
pubsub/connection.go

@@ -132,6 +132,12 @@ func (c *Connection) listenTopis() {
 
 	// Send LISTEN request
 	if c.Connection != nil && c.active {
+		// TODO: track bad topics and auto remove? [FUTURE]
+		// One bad topic will break all next topics
+
+		// The error message associated with the request, or an empty string if there is no error.
+		// For Bits and whispers events requests, error responses can be:
+		// ERR_BADMESSAGE, ERR_BADAUTH, ERR_SERVER, ERR_BADTOPIC
 		msg := Answer{Type: Listen, Data: AnswerDataTopics{Topics: topics}}.JSON()
 		if err := c.Connection.WriteMessage(websocket.TextMessage, msg); err != nil {
 			c.onError(err)