Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/nothub/tinyeventbus
- Owner: nothub
- License: mit
- Created: 2021-02-07T00:14:54.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-05T09:56:58.000Z (11 months ago)
- Last Synced: 2024-02-05T11:24:02.931Z (11 months ago)
- Topics: eventbus, java, pubsub
- Language: Java
- Homepage:
- Size: 200 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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)
.