Kyuso is a simple and flexible library for executing and scheduling tasks using Kotlin Coroutines or Java Executors
repositories {
maven(url = "https://maven.dimensional.fun/releases")
}
depenencies {
implementation("fun.dimensional:kyuso:$VERSION")
}
<repository>
<id>dimensional-maven-releases</id>
<name>Dimensional Maven</name>
<url>https://maven.dimensional.fun/releases</url>
</repository>
<dependency>
<groupId>fun.dimensional</groupId>
<artifactId>kyuso</artifactId>
<version>%VERSION%</version>
</dependency>
The coroutine backend uses Kotlin Coroutines to dispatch tasks.
val kyuso = Kyuso(Dispatchers.Default)
The executor backend uses Java Executors to dispatch tasks.
val kyuso = Kyuso(Executors.newSingleThreadExecutor())
kyuso.dispatch {
println("hello")
}
// executes every 1 second with no initial delay
kyuso.dispatchEvery(1.seconds, null) {
println("Hello World")
}
delay(5.seconds)
Licensed under the Apache License • Read more here