Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: provide topic in pubsub event #337

Merged
merged 7 commits into from
Nov 22, 2024

Conversation

dariusc93
Copy link
Owner

Previously, Ipfs::pubsub_events would provide PubsubEvent that would only provide the peer id related to the topic where the events are being listened on, however there was no. way to listen on all pubsub sub/unsub events. This PR changes it to allow there to be an optional topic filter so if a topic is not supplied, it would listen on all pubsub events, including the topic in PubsubEvent. If a topic is supplied, it will only emit events related to that topic, however the topic would be excluded from the event, assuming that the caller would perform their own tracking (ie using StreamMap, or their own preference when polling the stream).

CHANGELOG.md Outdated Show resolved Hide resolved
@dariusc93 dariusc93 marked this pull request as ready for review November 22, 2024 12:13
@dariusc93 dariusc93 merged commit 40fc428 into libp2p-next Nov 22, 2024
2 checks passed
@dariusc93 dariusc93 deleted the refactor/pubsub-event-topic branch November 22, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant