Closed lthibault closed 4 years ago
Sounds great, was one of the suggestions here (https://github.com/libp2p/go-libp2p-pubsub/issues/198#issuecomment-548896902) that has yet to be implemented.
Would welcome a PR.
@aschmahmann Done! Please see #370.
Due to the requirement of maintaining a single
*pubsub.Topic
handle per pubsub topic, it is often helpful to identify the topic to which a given handle belongs.Common solutions include:
map[string]*topic.Topic
*topic.Topic
, and exposes the topic string via aString() string
methodSeeing as how
*topic.Topic
already contains an unexportedtopic
field, it would be both trivial and extremely helpful to add the following method:I'm happy to submit a PR if there's any interest.