Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nothub/tinyeventbus

Tiny and fast pubsub implementation with subscriber priorities and event canceling for Java 8, 11 and 17.
https://github.com/nothub/tinyeventbus

eventbus java pubsub

Last synced: about 1 month ago
JSON representation

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

Awesome Lists containing this project

README

        

# TinyEventBus

[![maven central](https://maven-badges.herokuapp.com/maven-central/lol.hub/TinyEventBus/badge.svg)](https://search.maven.org/artifact/lol.hub/TinyEventBus)

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

---

###### usage

```java
void run() {
Bus bus = new Bus();
bus.reg(Sub.of(String.class, System.out::println));
bus.pub("Hello World!");
}
```

```java
class Listenable {
Sub 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](https://github.com/nothub/TinyEventBus/blob/master/src/test/java/lol/hub/tinyeventbus/example/Example.java)
.