go-libp2p icon indicating copy to clipboard operation
go-libp2p copied to clipboard

eventbus: on-demand emitters

Open Stebalien opened this issue 5 years ago • 2 comments

It would be nice to be able to emit events on-demand. That is, register a service with the event bus that's auto started/stopped based on the presence of subscribers.

This would:

  1. Allow us to auto-enable services like the AutoNAT client when we actually need them.
  2. Simplify dependency handling.

Stebalien avatar Mar 26 '20 21:03 Stebalien

Hi,@Stebalien . My idea is using a service struct to control the buses. If you approve, I can try to achieve it. Thanks.

Jun10ng avatar Jul 03 '20 07:07 Jun10ng

What's your use-case? At the moment, this isn't a really high priority for go-libp2p itself.

Stebalien avatar Jul 03 '20 22:07 Stebalien