| import kotlinx.coroutines.* |
| import kotlinx.coroutines.debug.* |
| suspend fun computeValue(): String = coroutineScope { |
| val one = async { computeOne() } |
| val two = async { computeTwo() } |
| suspend fun combineResults(one: Deferred<String>, two: Deferred<String>): String = |
| one.await() + two.await() |
| suspend fun computeOne(): String { |
| suspend fun computeTwo(): String { |
| fun main() = runBlocking { |
| val deferred = async { computeValue() } |
| // Dump running coroutines |
| DebugProbes.dumpCoroutines() |
| println("\nDumping only deferred") |
| DebugProbes.printJob(deferred) |