Skip to content
Kona

Concurrency

Concurrency helpers run work on JDK virtual threads so you can fan out CPU-light or IO-bound work without managing a thread pool by hand.

val doubled = Concurrency.map(listOf(1, 2, 3)) { it * 2 }

Empty input returns an empty list without starting an executor.

val results = Concurrency.run(
listOf(
Callable { fetchA() },
Callable { fetchB() },
)
)

Results preserve input order. Exceptions from a task propagate when the future is collected.