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

Support event setting filter #581

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gflkdns
Copy link

@gflkdns gflkdns commented Apr 28, 2019

Sometimes I just want to send a Bean out to let other members update ui or do other things.
But because of the characteristics of Eventbus, I have to define many types to wrap my data, which is very troublesome.
So I want to be able to set filters to ensure that those methods are not going to arrive.

I added a Filter parameter to the post method:

public interface Filter {
    /**
     * @param subscription
     * @return true is can invoke Subscriber false are not
     */
    public boolean allow(Subscription subscription);
}

This is the test code: EventBusFilterTest.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant