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

Add callbacks to EventBus #2002

Closed
wants to merge 1 commit into from
Closed

Add callbacks to EventBus #2002

wants to merge 1 commit into from

Conversation

smetarom
Copy link

I would appreciate a feature, where I can add additional functionality to EventBus. My main goal is to extend logging and debugging capabilities of EventBus.

My proposal is to create callbacks, which are overwritten in the child class. As at is now, I have to do logging before I call EventBus.post and it creates code duplication.

The simple example:

EventBus eventBus = new EventBus() {
@OverRide
protected void onEventPosted(Object event) {
// do some logging
}
};

I added onRegister, onUnregister, onEventPosted, and onNoSubscriberRegistered callbacks to corresponding methods.

Add onRegister, onUnregister, onEventPosted,
and onNoSubscriberRegistered callbacks
to corresponding methods.
@kluever
Copy link
Member

kluever commented Apr 19, 2021

We're unlikely to add new features to com.google.common.eventbus in the near future (and will in fact be recommending alternatives).

@kluever kluever closed this Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants