- Lightweight event bus with zero dependencies
- Lambda and annotation listener support
- Prioritisation and cancellation system
- Kotlin-first, with Java interop
- Full unit test coverage
- Single module: simple to use and integrate
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("io.github.dani-error:flux:1.0.0")
}Maven
<dependency> <groupId>io.github.dani-error</groupId> <artifactId>flux</artifactId> <version>1.0.0</version> </dependency>
class ExampleEvent : Event val bus = EventBus() bus.register<ExampleEvent> { event -> println("Received event") } bus.post(ExampleEvent())
Or using annotations:
class Listener { @Subscribe fun handle(event: ExampleEvent) { println("Event received") } } val bus = EventBus() bus.register(Listener()) bus.post(ExampleEvent())
Javadocs and examples can be found on the GitHub wiki.
Contributions welcome!
- Fork the repo.
- Create a feature branch:
git checkout -b feature/<your-feature>
- Commit your changes and open a Pull Request to
main.
Open an issue first for major changes.
Flux is licensed under the MIT License.