Ktbus
A simple EventBus implementation based on Kotlin SharedFlow and inspired by
Greenrobot EventBus.
Build

Concept and Usages
Setup
Use MavenCentral in settings.gradle.kts:
repositories {
mavenCentral()
}
Include in application build.gradle.kts:
dependencies {
implementation("org.holance:ktbus:{version}")
}
Make sure to replace {version} with the version of the library.
Publish/Subscribe
flowchart TD
A["Publisher"] --> B(("SharedFlow"))
B --> C["Subscriber 1"] & D["Subscriber 2"]
Example
Request/Response
flowchart TD
n1["Request"] --> n2(("SharedFlow"))
n2 --> n3["Subscriber"]
n3 -- Response --> n2
n2 -- Response --> n1
Example
Use Channel
Compile-Time Channel
Runtime Channel