CoroutineExtensions

Small library with extensions to Coroutines missing in coroutines-core.
Setup
Gradle
implementation("net.codinux.kotlin:coroutine-extensions:1.0.1")
Maven
<dependency>
<groupId>net.codinux.web</groupId>
<artifactId>coroutine-extensions-jvm</artifactId>
<version>1.0.1</version>
</dependency>
Usage
Dispatchers Extensions
In Kotlin Multiplatform projects, you often want to use Dispatchers.IO in common code for tasks like network calls, which is not possible as JS has no Dispatchers.IO.
So I created Dispatchers.IOorDefault which runs on Dispatchers.IO on all platforms but JS and on Dispatchers.Default on JS and WASM.
suspend fun fetchFromNetwork() = withContext(Dispatchers.IOorDefault) {
}
License
Copyright 2025 codinux GmbH & Co.KG
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance the License.
You may obtain a copy of the License at
https:
Unless applicable law agreed to writing, software
distributed under the License distributed an BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express implied.
See the License the specific language governing permissions
limitations under the License.