libp2p / libp2p/go-libp2p

eventbus: subscribers should know if there are any emitters for a event/s

Open
#1,705 6 comments 0 reactions 1 assignee View on GitHub

@aarshkshah1992 is already working on this.

Since Mar 20, 2020.

Dominant language
Go
Stars
6.9k
Forks
1.3k
Avg merge
13d 21h
Merged PRs (30d)
1

Description

Subscribers should be able to know if the eventbus has emitter for some event/s. This would allow the component housing the subscriber to close the subscriber if no emitters exist and execute some other code path if needed.

This would entail:

  1. "Closing the eventbus" for registering emitters.
  2. Informing the subscribers that the eventbus has been closed to emitters via a "meta-event" that interested subscribers subscribe to.
  3. Subscribers would call Subscription.GetEmitters or something similar to find out if there are any emitters after receiving the "meta-event".

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.