@@ -687,8 +687,7 @@ fun <T, U> Publisher<T>.takeUntil(context: CoroutineContext, other: Publisher<U>
687687```
688688
689689This code is using [ whileSelect] as a nicer shortcut to ` while(select{...}) {} ` loop and Kotlin's
690- [ use] ( https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io/use.html )
691- expression to close the channels on exit, which unsubscribes from the corresponding publishers.
690+ [ consume] expressions to close the channels on exit, which unsubscribes from the corresponding publishers.
692691
693692The following hand-written combination of
694693[ range] ( https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html#range(int,%20int) ) with
@@ -751,11 +750,8 @@ fun <T> Publisher<Publisher<T>>.merge(context: CoroutineContext) = GlobalScope.p
751750}
752751```
753752
754- Notice the use of
755- [ coroutineContext] ( https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.coroutines/coroutine-context.html )
756- in the invocation of [ launch] coroutine builder. It is used to refer
757- to the context of the enclosing ` publish ` coroutine. This way, all the coroutines that are
758- being launched here are [ children] ( ../docs/coroutines-guide.md#children-of-a-coroutine ) of the ` publish `
753+ Notice that all the coroutines that are
754+ being launched here are the children of the ` publish `
759755coroutine and will get cancelled when the ` publish ` coroutine is cancelled or is otherwise completed.
760756Moreover, since the parent coroutine waits until all the children are complete, this implementation fully
761757merges all the received streams.
@@ -1052,7 +1048,6 @@ coroutines for complex pipelines with fan-in and fan-out between multiple worker
10521048[ runBlocking ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/run-blocking.html
10531049[ Dispatchers.Unconfined ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-dispatchers/-unconfined.html
10541050[ yield ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/yield.html
1055- [ launch ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/launch.html
10561051[ Dispatchers.Default ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-dispatchers/-default.html
10571052[ Job.join ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-job/join.html
10581053<!-- - INDEX kotlinx.coroutines.channels -->
0 commit comments