Skip to content

⏱️ task execution and scheduling in kotlin

License

Notifications You must be signed in to change notification settings

dimensional-fun/kyuso

Repository files navigation

Kyuso

Kyuso is a simple and flexible library for executing and scheduling tasks using Kotlin Coroutines or Java Executors

Installation

Gradle
repositories {
    maven(url = "https://maven.dimensional.fun/releases")
}

depenencies {
    implementation("fun.dimensional:kyuso:$VERSION")
}
Maven
<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>

Usage

Coroutine Backend

The coroutine backend uses Kotlin Coroutines to dispatch tasks.

val kyuso = Kyuso(Dispatchers.Default)
Executor Backend

The executor backend uses Java Executors to dispatch tasks.

val kyuso = Kyuso(Executors.newSingleThreadExecutor())

Example

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

About

⏱️ task execution and scheduling in kotlin

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages