Skip to content

Ability to be notified when subscribers are added/removed #411

@palto-blubek

Description

@palto-blubek

Hi!
I was working on a "location manager" that handles starting a Google Play Services client, then starts to listen to location changes, and sends them using EventBus.
Then I realized that, for battery saving reasons, the listening to locations changes should be only started if there is at least one interested party (a component that subscribed to my event). And it should stop when there are no more subscribers.

I didn't find a way to be notified when subscribers of a particular event are added/removed - did I miss an API or is this something that was considered? Or maybe there is another way to do this?

Thanks a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions