File tree 2 files changed +4
-4
lines changed
kotlinx-coroutines-rx-example/src/main/kotlin
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ private fun startLongAsyncOperation(v: Int) =
21
21
}
22
22
23
23
fun main (args : Array <String >) {
24
- val future = async< String > {
24
+ val future = async {
25
25
(1 .. 5 ).map {
26
26
await(startLongAsyncOperation(it))
27
27
}.joinToString(" \n " )
@@ -39,7 +39,7 @@ it will not work with earlier versions.
39
39
import kotlinx.coroutines.generate
40
40
41
41
fun main (args : Array <String >) {
42
- val sequence = generate< Int > {
42
+ val sequence = generate {
43
43
for (i in 1 .. 5 ) {
44
44
yield (i)
45
45
}
@@ -75,7 +75,7 @@ fun main(args: Array<String>) {
75
75
76
76
val github = retrofit.create(GitHub ::class .java)
77
77
78
- asyncRx< Unit > {
78
+ asyncRx {
79
79
for (org in listOf (" Kotlin" , " ReactiveX" )) {
80
80
// `awaitSingle()` call here is a suspension point,
81
81
// i.e. coroutine's code stops on it until request is not completed
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ fun main(args: Array<String>) {
42
42
43
43
val otherRepos =
44
44
github.listRepos(name).awaitSingle()
45
- .map { it. name } .joinToString(" , " )
45
+ .map( Repo :: name) .joinToString(" , " )
46
46
47
47
println (otherRepos)
48
48
}
You can’t perform that action at this time.
0 commit comments