Skip to content

Commit 7c01501

Browse files
State before the channel lecture
1 parent 384bc41 commit 7c01501

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.lukaslechner.coroutineusecasesonandroid.playground.flow.channels
2+
3+
import kotlinx.coroutines.async
4+
import kotlinx.coroutines.coroutineScope
5+
import kotlinx.coroutines.delay
6+
import kotlinx.coroutines.launch
7+
8+
suspend fun main(): Unit = coroutineScope {
9+
10+
val deferred = async {
11+
delay(100) // some computation
12+
10
13+
}
14+
15+
launch {
16+
val result = deferred.await()
17+
println(result)
18+
}
19+
}

0 commit comments

Comments
 (0)