Skip to content

Commit 2f6f6f6

Browse files
committed
Merge branch 'master' into develop
2 parents 9ea4fea + c38ecb6 commit 2f6f6f6

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# kotlinx.coroutines
22

3-
[![official JetBrains project](https://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
3+
[![Kotlin Stable](https://kotl.in/badges/stable.svg)](https://kotlinlang.org/docs/components-stability.html)
4+
[![JetBrains official project](https://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
45
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)
56
[![Download](https://img.shields.io/maven-central/v/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.6.1)](https://search.maven.org/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.6.1/pom)
67
[![Kotlin](https://img.shields.io/badge/kotlin-1.6.0-blue.svg?logo=kotlin)](http://kotlinlang.org)

docs/topics/channels.md

+3
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,7 @@ Now let's see how it works in practice:
573573
import kotlinx.coroutines.*
574574
import kotlinx.coroutines.channels.*
575575

576+
//sampleStart
576577
fun main() = runBlocking<Unit> {
577578
val tickerChannel = ticker(delayMillis = 100, initialDelayMillis = 0) // create ticker channel
578579
var nextElement = withTimeoutOrNull(1) { tickerChannel.receive() }
@@ -596,7 +597,9 @@ fun main() = runBlocking<Unit> {
596597

597598
tickerChannel.cancel() // indicate that no more elements are needed
598599
}
600+
//sampleEnd
599601
```
602+
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
600603

601604
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-channel-10.kt).
602605
>

docs/topics/exception-handling.md

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ It can be demonstrated by a simple example that creates root coroutines using th
2828
```kotlin
2929
import kotlinx.coroutines.*
3030

31+
//sampleStart
3132
@OptIn(DelicateCoroutinesApi::class)
3233
fun main() = runBlocking {
3334
val job = GlobalScope.launch { // root coroutine with launch
@@ -47,7 +48,9 @@ fun main() = runBlocking {
4748
println("Caught ArithmeticException")
4849
}
4950
}
51+
//sampleEnd
5052
```
53+
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
5154

5255
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-exceptions-01.kt).
5356
>

kotlinx-coroutines-core/common/src/flow/operators/Limit.kt

-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ public fun <T> Flow<T>.takeWhile(predicate: suspend (T) -> Boolean): Flow<T> = f
109109
* emit(progress) // always emit progress
110110
* !progress.isDone() // continue while download is not done
111111
* }
112-
* }
113112
* ```
114113
*/
115114
public fun <T, R> Flow<T>.transformWhile(

kotlinx-coroutines-core/common/src/flow/operators/Transform.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public fun <T> Flow<T>.onEach(action: suspend (T) -> Unit): Flow<T> = transform
8181
* ```
8282
* flowOf(1, 2, 3).scan(emptyList<Int>()) { acc, value -> acc + value }.toList()
8383
* ```
84-
* will produce `[], [1], [1, 2], [1, 2, 3]]`.
84+
* will produce `[], [1], [1, 2], [1, 2, 3]`.
8585
*
8686
* This function is an alias to [runningFold] operator.
8787
*/
@@ -94,7 +94,7 @@ public fun <T, R> Flow<T>.scan(initial: R, @BuilderInference operation: suspend
9494
* ```
9595
* flowOf(1, 2, 3).runningFold(emptyList<Int>()) { acc, value -> acc + value }.toList()
9696
* ```
97-
* will produce `[], [1], [1, 2], [1, 2, 3]]`.
97+
* will produce `[], [1], [1, 2], [1, 2, 3]`.
9898
*/
9999
public fun <T, R> Flow<T>.runningFold(initial: R, @BuilderInference operation: suspend (accumulator: R, value: T) -> R): Flow<R> = flow {
100100
var accumulator: R = initial

kotlinx-coroutines-debug/src/CoroutinesBlockHoundIntegration.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public class CoroutinesBlockHoundIntegration : BlockHoundIntegration {
117117
private fun BlockHound.Builder.allowBlockingCallsInArrayChannel() {
118118
for (method in listOf(
119119
"pollInternal", "isEmpty", "isFull", "isClosedForReceive", "offerInternal", "offerSelectInternal",
120-
"enqueueSend", "pollInternal", "pollSelectInternal", "enqueueReceiveInternal", "onCancelIdempotent"))
120+
"enqueueSend", "pollSelectInternal", "enqueueReceiveInternal", "onCancelIdempotent"))
121121
{
122122
allowBlockingCallsInside("kotlinx.coroutines.channels.ArrayChannel", method)
123123
}

0 commit comments

Comments
 (0)