EventBus
EventBus copied to clipboard
Support event setting filter
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