bennidi / mbassador

Powerful event-bus optimized for high throughput in multi-threaded applications. Features: Sync and Async event publication, weak/strong references, event filtering, annotation driven
MIT License
955 stars 146 forks source link

Unsubscribe all and purge feature #156

Closed eduardoestrella closed 2 years ago

eduardoestrella commented 6 years ago

Features

Unsubscribe all

Remove subscribed listeners and keep the clases associated to the subscriptions. Recomended for use cases when need unsubscribe all existing listeners but don't want remove the association with the register class. The next time you subscribe a class already subcribed it will reuse this instance and only update listeners. Improve the performance.

MBassador bus = new MBassador();
bus.unsubscribeAll();

Purge

Remove all subscribed class and their listener associated. Force clean the whole subscription list. Recomended for use cases when your cycle of life subscribe new instances of already existing classes and you can't unsbuscribe old one.

MBassador bus = new MBassador();
bus.purge();
eduardoestrella commented 6 years ago

@bennidi , Travis CI seems has a problem with OpenJDK6. Let me know if I can help you with this. thank you.