Skip to content

Repository files navigation

Kanal

CI Kotlin JVM Maven License

A Kotlin-first, Java-compatible event-handler library for the JVM.

Modules

Module Description Java compatible
kanal-core Core event bus - annotation and lambda subscribers, priority dispatch, cancellable and modifiable events, supertype dispatch, async handlers Yes
kanal-coroutines Coroutines extensions - asFlow, postSuspend, suspendHandler, nextEvent Kotlin only

Installation

kanal-core

repositories {
    maven("https://maven.meteordev.org/releases") {
        name = "meteordev"
    }
}

dependencies {
    implementation("io.github.big-iron-cheems:kanal-core:$VERSION")
}

kanal-coroutines

Depends on kanal-core automatically via api().

dependencies {
    implementation("io.github.big-iron-cheems:kanal-coroutines:$VERSION")
}

Replace the placeholder $VERSION with the latest version shown in the badge above.

Quick example

class PlayerJumpEvent(val player: String) : Event

val bus = EventBus()
bus.subscribe<PlayerJumpEvent> { e -> println("${e.player} jumped!") }
bus.post(PlayerJumpEvent("Steve"))

See the module READMEs for the full API surface, Java usage, async dispatch, coroutines integration, and performance data.

Documentation

The project specification is written in Typst under docs/. To build the PDF locally, install Typst and run:

typst compile docs/kanal.typ docs/kanal.pdf

License

Apache 2.0, see LICENSE.

About

A Kotlin-first, Java-compatible event-handler library.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages