Browse Source

Implement Connection.Topics

Volodymyr Tkach 2 years ago
parent
commit
67c8ddbbe2
1 changed files with 5 additions and 2 deletions
  1. 5 2
      pubsub/connection.go

+ 5 - 2
pubsub/connection.go

@@ -159,8 +159,11 @@ func (c *Connection) RemoveTopic(topic string) {
 
 // Topics returns all current listen topics.
 func (c *Connection) Topics() []string {
-	// TODO: ...
-	return []string{}
+	topics := []string{}
+	for topic := range c.topics {
+		topics = append(topics, topic)
+	}
+	return topics
 }
 
 // Close is close connection and shutdown all goroutines.