Skip to content

mooncloak/ktask

ktask

Kotlin task runner facade.

GitHub tag (latest by date)

Status ⚠️

Warning

This project is being actively developed but is in an early experimental state. Use the library cautiously and report back any issues. mooncloak is not responsible for any issues faced when using the library.

Getting Started 🏁

Checkout the releases page to get the latest version.

GitHub tag (latest by date)

Repository

repositories {
    maven("https://repo.repsy.io/mvn/mooncloak/public")
}

Dependencies

Core Components:

implementation("com.mooncloak.kodetools.ktask:ktask-core:VERSION")

Ktor Server Plugin:

implementation("com.mooncloak.kodetools.ktask:ktask-ktor:VERSION")

Usage

Ktor Server Plugin

Install the plugin

import com.mooncloak.kodetools.ktask.ktor.TaskService

fun Application.module() {
    install(TaskService)
}

Schedule tasks for execution

// Adds a Task to the execution queue and suspends until is finished being scheduled
application.taskService.enqueue {
    // Perform the task logic
}

// Adds a Task to the execution queue asynchronously
application.taskService.launchEnqueue {
    // Perform the task logic
}

Documentation 📃

More detailed documentation is available in the docs folder. The entry point to the documentation can be found here.

Security 🛡️

For security vulnerabilities, concerns, or issues, please refer to the security policy for more information on appropriate approaches for disclosure.

Contributing ✍️

Outside contributions are welcome for this project. Please follow the code of conduct and coding conventions when contributing. If contributing code, please add thorough documents and tests. Thank you!

License ⚖️

Copyright 2025 mooncloak

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

A Ktor server task runner

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Languages