Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Latest commit

 

History

History
32 lines (25 loc) · 764 Bytes

README.md

File metadata and controls

32 lines (25 loc) · 764 Bytes

TinyEventBus

maven central

Tiny and fast pubsub implementation with subscriber priorities and event canceling for Java.


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 .