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: 25 days ago
JSON representation
Tiny and fast pubsub implementation with subscriber priorities and event canceling for Java 8, 11 and 17.
- Host: GitHub
- URL: https://github.com/nothub/tinyeventbus
- Owner: nothub
- License: mit
- Archived: true
- Created: 2021-02-07T00:14:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-09-02T16:57:06.000Z (9 months ago)
- Last Synced: 2024-11-18T21:23:27.758Z (6 months ago)
- Topics: eventbus, java, pubsub
- Language: Java
- Homepage:
- Size: 229 KB
- Stars: 14
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# TinyEventBus
[](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)
.