TinyEventBus icon indicating copy to clipboard operation
TinyEventBus copied to clipboard

Tiny and fast pubsub implementation with subscriber priorities and event canceling for Java 8, 11 and 17.

TinyEventBus

maven central LGTM

Tiny and fast pubsub implementation with subscriber priorities and event canceling for Java 8, 11 and 17.


usage
void run() {
    Bus bus = new Bus();
    bus.reg(Sub.of(String.class, System.out::println));
    bus.pub("Hello World!");
}
class Listenable {
    Sub<Long> sub = Sub.of(Long.class, l -> Foo.bar(l));
    void run() {
        Bus bus = new Bus();
        bus.reg(this);
        bus.pub(42L);
    }
}

For more explanation, check the example .