go-libp2p
go-libp2p copied to clipboard
eventbus: on-demand emitters
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:
- Allow us to auto-enable services like the AutoNAT client when we actually need them.
- Simplify dependency handling.
Hi,@Stebalien . My idea is using a service struct to control the buses. If you approve, I can try to achieve it. Thanks.
What's your use-case? At the moment, this isn't a really high priority for go-libp2p itself.