EventBus icon indicating copy to clipboard operation
EventBus copied to clipboard

Support event setting filter

Open gflkdns opened this issue 6 years ago • 0 comments

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

gflkdns avatar Apr 28 '19 12:04 gflkdns