From f9a4545e5d759595153dd089013cad141c96555b Mon Sep 17 00:00:00 2001 From: Oleg Yukhnevich Date: Thu, 28 Mar 2024 12:27:08 +0200 Subject: [PATCH 01/11] Update Dokka to 1.9.20 (#4057) --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 9536e717b2..f1966df8af 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,7 @@ junit5_version=5.7.0 knit_version=0.5.0 html_version=0.7.2 lincheck_version=2.18.1 -dokka_version=1.9.10 +dokka_version=1.9.20 byte_buddy_version=1.10.9 reactor_version=3.4.1 reactive_streams_version=1.0.3 From d106ac7c362c54fdeffacc6af0b161ed107babaa Mon Sep 17 00:00:00 2001 From: Victoria Petrakovich <78360457+PetrakovichVictoria@users.noreply.github.com> Date: Wed, 3 Apr 2024 12:25:48 +0200 Subject: [PATCH 02/11] Docs: avoid scrolling sample code; fix test description; add () to functions calls (#4080) --- docs/topics/coroutines-and-channels.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/topics/coroutines-and-channels.md b/docs/topics/coroutines-and-channels.md index b60d8982a0..4fcb413ce1 100644 --- a/docs/topics/coroutines-and-channels.md +++ b/docs/topics/coroutines-and-channels.md @@ -91,7 +91,10 @@ This API is used by the `loadContributorsBlocking()` function to fetch the list 1. Open `src/tasks/Request1Blocking.kt` to see its implementation: ```kotlin - fun loadContributorsBlocking(service: GitHubService, req: RequestData): List { + fun loadContributorsBlocking( + service: GitHubService, + req: RequestData + ): List { val repos = service .getOrgReposCall(req.org) // #1 .execute() // #2 @@ -328,7 +331,8 @@ fun loadContributorsCallbacks( * The logic for handling the responses is extracted into callbacks: the corresponding lambdas start at lines `#1` and `#2`. However, the provided solution doesn't work. If you run the program and load contributors by choosing the _CALLBACKS_ -option, you'll see that nothing is shown. However, the tests that immediately return the result pass. +option, you'll see that nothing is shown. However, the test from `Request3CallbacksKtTest` immediately returns the result +that it successfully passed. Think about why the given code doesn't work as expected and try to fix it, or see the solutions below. @@ -1206,8 +1210,8 @@ When the channel is full, the next `send` call on it is suspended until more fre

The "Rendezvous" channel is a channel without a buffer, the same as a buffered channel with zero size. One of the functions (send() or receive()) is always suspended until the other is called.

-

If the send() function is called and there's no suspended receive call ready to process the element, then send() -is suspended. Similarly, if the receive function is called and the channel is empty or, in other words, there's no +

If the send() function is called and there's no suspended receive() call ready to process the element, then send() +is suspended. Similarly, if the receive() function is called and the channel is empty or, in other words, there's no suspended send() call ready to send the element, the receive() call is suspended.

The "rendezvous" name ("a meeting at an agreed time and place") refers to the fact that send() and receive() should "meet on time".

From 74774df13a8dd30980a96add574c19b2f2edbfca Mon Sep 17 00:00:00 2001 From: Victoria Petrakovich <78360457+PetrakovichVictoria@users.noreply.github.com> Date: Wed, 3 Apr 2024 12:27:49 +0200 Subject: [PATCH 03/11] Docs: reference to The Hitchhiker's Guide to the Galaxy (#4082) At the end of the book, they multiply 6 * 7 :) --- docs/topics/coroutine-context-and-dispatchers.md | 8 ++++---- .../jvm/test/guide/example-context-08.kt | 6 +++--- .../jvm/test/guide/test/DispatcherGuideTest.kt | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/topics/coroutine-context-and-dispatchers.md b/docs/topics/coroutine-context-and-dispatchers.md index 969bd21eb9..4cc67f0423 100644 --- a/docs/topics/coroutine-context-and-dispatchers.md +++ b/docs/topics/coroutine-context-and-dispatchers.md @@ -420,14 +420,14 @@ fun main() = runBlocking(CoroutineName("main")) { val v1 = async(CoroutineName("v1coroutine")) { delay(500) log("Computing v1") - 252 + 6 } val v2 = async(CoroutineName("v2coroutine")) { delay(1000) log("Computing v2") - 6 + 7 } - log("The answer for v1 / v2 = ${v1.await() / v2.await()}") + log("The answer for v1 * v2 = ${v1.await() * v2.await()}") //sampleEnd } ``` @@ -443,7 +443,7 @@ The output it produces with `-Dkotlinx.coroutines.debug` JVM option is similar t [main @main#1] Started main coroutine [main @v1coroutine#2] Computing v1 [main @v2coroutine#3] Computing v2 -[main @main#1] The answer for v1 / v2 = 42 +[main @main#1] The answer for v1 * v2 = 42 ``` diff --git a/kotlinx-coroutines-core/jvm/test/guide/example-context-08.kt b/kotlinx-coroutines-core/jvm/test/guide/example-context-08.kt index 0ab1a3ee48..bb871662b6 100644 --- a/kotlinx-coroutines-core/jvm/test/guide/example-context-08.kt +++ b/kotlinx-coroutines-core/jvm/test/guide/example-context-08.kt @@ -11,12 +11,12 @@ fun main() = runBlocking(CoroutineName("main")) { val v1 = async(CoroutineName("v1coroutine")) { delay(500) log("Computing v1") - 252 + 6 } val v2 = async(CoroutineName("v2coroutine")) { delay(1000) log("Computing v2") - 6 + 7 } - log("The answer for v1 / v2 = ${v1.await() / v2.await()}") + log("The answer for v1 * v2 = ${v1.await() * v2.await()}") } diff --git a/kotlinx-coroutines-core/jvm/test/guide/test/DispatcherGuideTest.kt b/kotlinx-coroutines-core/jvm/test/guide/test/DispatcherGuideTest.kt index 5a4bb9939c..1cf6c2bd4d 100644 --- a/kotlinx-coroutines-core/jvm/test/guide/test/DispatcherGuideTest.kt +++ b/kotlinx-coroutines-core/jvm/test/guide/test/DispatcherGuideTest.kt @@ -77,7 +77,7 @@ class DispatcherGuideTest { "[main @main#1] Started main coroutine", "[main @v1coroutine#2] Computing v1", "[main @v2coroutine#3] Computing v2", - "[main @main#1] The answer for v1 / v2 = 42" + "[main @main#1] The answer for v1 * v2 = 42" ) } From 01485343b4fab3692d0806b4c3706b23c6b04f1d Mon Sep 17 00:00:00 2001 From: Victoria Petrakovich <78360457+PetrakovichVictoria@users.noreply.github.com> Date: Wed, 3 Apr 2024 14:10:43 +0200 Subject: [PATCH 04/11] chore: fix identation in example loadContributorsBlocking() (#4085) --- docs/topics/coroutines-and-channels.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/topics/coroutines-and-channels.md b/docs/topics/coroutines-and-channels.md index 4fcb413ce1..e3cb7e5a42 100644 --- a/docs/topics/coroutines-and-channels.md +++ b/docs/topics/coroutines-and-channels.md @@ -92,8 +92,8 @@ This API is used by the `loadContributorsBlocking()` function to fetch the list ```kotlin fun loadContributorsBlocking( - service: GitHubService, - req: RequestData + service: GitHubService, + req: RequestData ): List { val repos = service .getOrgReposCall(req.org) // #1 From 20707d35acb124fdadbd96eafef4edb8294c2e46 Mon Sep 17 00:00:00 2001 From: Victoria Petrakovich <78360457+PetrakovichVictoria@users.noreply.github.com> Date: Wed, 3 Apr 2024 16:09:08 +0200 Subject: [PATCH 05/11] fix: remove `sampleStart` and `sampleEnd` comments from example in coroutine-context-and-dispatchers.md (#4081) --- docs/topics/coroutine-context-and-dispatchers.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/topics/coroutine-context-and-dispatchers.md b/docs/topics/coroutine-context-and-dispatchers.md index 4cc67f0423..3a52ce1d2a 100644 --- a/docs/topics/coroutine-context-and-dispatchers.md +++ b/docs/topics/coroutine-context-and-dispatchers.md @@ -227,7 +227,6 @@ import kotlinx.coroutines.* fun log(msg: String) = println("[${Thread.currentThread().name}] $msg") fun main() { -//sampleStart newSingleThreadContext("Ctx1").use { ctx1 -> newSingleThreadContext("Ctx2").use { ctx2 -> runBlocking(ctx1) { @@ -239,7 +238,6 @@ fun main() { } } } -//sampleEnd } ``` From f8d1821f137cad86561723e8a1a0bf8a3a81fda1 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Fri, 12 Apr 2024 02:02:41 +0900 Subject: [PATCH 06/11] Fix typo in coroutine-context-and-dispatchers.md (#3941) --- docs/topics/coroutine-context-and-dispatchers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/topics/coroutine-context-and-dispatchers.md b/docs/topics/coroutine-context-and-dispatchers.md index 3a52ce1d2a..ffbb364289 100644 --- a/docs/topics/coroutine-context-and-dispatchers.md +++ b/docs/topics/coroutine-context-and-dispatchers.md @@ -502,7 +502,7 @@ class Activity { // to be continued ... ``` -Now, we can launch coroutines in the scope of this `Activity` using the defined `scope`. +Now, we can launch coroutines in the scope of this `Activity` using the defined `mainScope`. For the demo, we launch ten coroutines that delay for a different time: ```kotlin From 515308dc3d5fe0624f235cb9fd84358e7e59b7a1 Mon Sep 17 00:00:00 2001 From: Victoria Petrakovich <78360457+PetrakovichVictoria@users.noreply.github.com> Date: Tue, 16 Apr 2024 10:06:25 +0200 Subject: [PATCH 07/11] fix: get rid of horizontal scrolling by splitting the comment and show more code mentioned (#4100) --- docs/topics/channels.md | 5 +++-- kotlinx-coroutines-core/jvm/test/guide/example-channel-01.kt | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/topics/channels.md b/docs/topics/channels.md index 3b8b11fbbe..019dae8476 100644 --- a/docs/topics/channels.md +++ b/docs/topics/channels.md @@ -19,7 +19,8 @@ fun main() = runBlocking { //sampleStart val channel = Channel() launch { - // this might be heavy CPU-consuming computation or async logic, we'll just send five squares + // this might be heavy CPU-consuming computation or async logic, + // we'll just send five squares for (x in 1..5) channel.send(x * x) } // here we print five received integers: @@ -103,12 +104,12 @@ and an extension function [consumeEach], that replaces a `for` loop on the consu import kotlinx.coroutines.* import kotlinx.coroutines.channels.* +//sampleStart fun CoroutineScope.produceSquares(): ReceiveChannel = produce { for (x in 1..5) send(x * x) } fun main() = runBlocking { -//sampleStart val squares = produceSquares() squares.consumeEach { println(it) } println("Done!") diff --git a/kotlinx-coroutines-core/jvm/test/guide/example-channel-01.kt b/kotlinx-coroutines-core/jvm/test/guide/example-channel-01.kt index d68c113bd2..8c9845afa5 100644 --- a/kotlinx-coroutines-core/jvm/test/guide/example-channel-01.kt +++ b/kotlinx-coroutines-core/jvm/test/guide/example-channel-01.kt @@ -7,7 +7,8 @@ import kotlinx.coroutines.channels.* fun main() = runBlocking { val channel = Channel() launch { - // this might be heavy CPU-consuming computation or async logic, we'll just send five squares + // this might be heavy CPU-consuming computation or async logic, + // we'll just send five squares for (x in 1..5) channel.send(x * x) } // here we print five received integers: From f22b229a09fb0a1959c3eb26fccc24bd7cb3fafb Mon Sep 17 00:00:00 2001 From: Victoria Petrakovich <78360457+PetrakovichVictoria@users.noreply.github.com> Date: Mon, 22 Apr 2024 14:35:56 +0200 Subject: [PATCH 08/11] fix the link to `Thread.uncaughtExceptionHandler` --- docs/topics/exception-handling.md | 4 ++-- .../jvm/test/guide/test/ExceptionsGuideTest.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/topics/exception-handling.md b/docs/topics/exception-handling.md index ab1ec6a49a..f79740c95f 100644 --- a/docs/topics/exception-handling.md +++ b/docs/topics/exception-handling.md @@ -60,7 +60,7 @@ The output of this code is (with [debug](https://github.com/Kotlin/kotlinx.corou ```text Throwing exception from launch -Exception in thread "DefaultDispatcher-worker-2 @coroutine#2" java.lang.IndexOutOfBoundsException +Exception in thread "DefaultDispatcher-worker-1 @coroutine#2" java.lang.IndexOutOfBoundsException Joined failed job Throwing exception from async Caught ArithmeticException @@ -73,7 +73,7 @@ Caught ArithmeticException It is possible to customize the default behavior of printing **uncaught** exceptions to the console. [CoroutineExceptionHandler] context element on a _root_ coroutine can be used as a generic `catch` block for this root coroutine and all its children where custom exception handling may take place. -It is similar to [`Thread.uncaughtExceptionHandler`](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler)). +It is similar to [`Thread.uncaughtExceptionHandler`](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#setUncaughtExceptionHandler-java.lang.Thread.UncaughtExceptionHandler-). You cannot recover from the exception in the `CoroutineExceptionHandler`. The coroutine had already completed with the corresponding exception when the handler is called. Normally, the handler is used to log the exception, show some kind of error message, terminate, and/or restart the application. diff --git a/kotlinx-coroutines-core/jvm/test/guide/test/ExceptionsGuideTest.kt b/kotlinx-coroutines-core/jvm/test/guide/test/ExceptionsGuideTest.kt index 33da0a7bc7..dc600616e1 100644 --- a/kotlinx-coroutines-core/jvm/test/guide/test/ExceptionsGuideTest.kt +++ b/kotlinx-coroutines-core/jvm/test/guide/test/ExceptionsGuideTest.kt @@ -9,7 +9,7 @@ class ExceptionsGuideTest { fun testExampleExceptions01() { test("ExampleExceptions01") { kotlinx.coroutines.guide.exampleExceptions01.main() }.verifyExceptions( "Throwing exception from launch", - "Exception in thread \"DefaultDispatcher-worker-2 @coroutine#2\" java.lang.IndexOutOfBoundsException", + "Exception in thread \"DefaultDispatcher-worker-1 @coroutine#2\" java.lang.IndexOutOfBoundsException", "Joined failed job", "Throwing exception from async", "Caught ArithmeticException" From 2430d9a799de6fdbe0ce89e5e61e1d8d4cfdfb1e Mon Sep 17 00:00:00 2001 From: Dmitry Khalanskiy <52952525+dkhalanskyjb@users.noreply.github.com> Date: Thu, 25 Apr 2024 10:48:29 +0200 Subject: [PATCH 09/11] Fix broken API reference links to the Project Reactor Javadoc (#4111) See --- gradle.properties | 1 + reactive/kotlinx-coroutines-reactor/build.gradle.kts | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index f1966df8af..ef0764dc37 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,6 +14,7 @@ lincheck_version=2.18.1 dokka_version=1.9.20 byte_buddy_version=1.10.9 reactor_version=3.4.1 +reactor_docs_version=3.4.5 reactive_streams_version=1.0.3 rxjava2_version=2.2.8 rxjava3_version=3.0.2 diff --git a/reactive/kotlinx-coroutines-reactor/build.gradle.kts b/reactive/kotlinx-coroutines-reactor/build.gradle.kts index e1bc732a07..6e46d912b5 100644 --- a/reactive/kotlinx-coroutines-reactor/build.gradle.kts +++ b/reactive/kotlinx-coroutines-reactor/build.gradle.kts @@ -5,10 +5,8 @@ plugins { id("org.jetbrains.kotlinx.kover") } -val reactorVersion = version("reactor") - dependencies { - api("io.projectreactor:reactor-core:$reactorVersion") + api("io.projectreactor:reactor-core:${version("reactor")}") api(project(":kotlinx-coroutines-reactive")) } @@ -27,8 +25,10 @@ tasks { } } +// the version of the docs can be different from the version of the Reactor +// library itself: https://github.com/reactor/reactor-core/issues/3794 externalDocumentationLink( - url = "https://projectreactor.io/docs/core/$reactorVersion/api/" + url = "https://projectreactor.io/docs/core/${version("reactor_docs")}/api/" ) From c1ba5af8c5d10a3d2f923f89b98f6ab1b394e24d Mon Sep 17 00:00:00 2001 From: Dmitry Khalanskiy <52952525+dkhalanskyjb@users.noreply.github.com> Date: Thu, 25 Apr 2024 10:49:04 +0200 Subject: [PATCH 10/11] Fix the ticker channel example giving wrong results on the website (#4109) https://play.kotlinlang.org/ of the example that's being changed here is currently unreliable: the last line is occasionally `null`. By increasing all time intervals twofold, we reduce the impact of the CPU scheduling in the constrained environment. With this change, the results are consistent across dozens of runs: Originally reported by `@PetrakovichVictoria` --- docs/topics/channels.md | 26 +++++++++---------- .../jvm/test/guide/example-channel-10.kt | 18 ++++++------- .../jvm/test/guide/test/ChannelsGuideTest.kt | 8 +++--- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/docs/topics/channels.md b/docs/topics/channels.md index 019dae8476..6820f4c93c 100644 --- a/docs/topics/channels.md +++ b/docs/topics/channels.md @@ -576,25 +576,25 @@ import kotlinx.coroutines.channels.* //sampleStart fun main() = runBlocking { - val tickerChannel = ticker(delayMillis = 100, initialDelayMillis = 0) // create ticker channel + val tickerChannel = ticker(delayMillis = 200, initialDelayMillis = 0) // create a ticker channel var nextElement = withTimeoutOrNull(1) { tickerChannel.receive() } println("Initial element is available immediately: $nextElement") // no initial delay - nextElement = withTimeoutOrNull(50) { tickerChannel.receive() } // all subsequent elements have 100ms delay - println("Next element is not ready in 50 ms: $nextElement") + nextElement = withTimeoutOrNull(100) { tickerChannel.receive() } // all subsequent elements have 200ms delay + println("Next element is not ready in 100 ms: $nextElement") - nextElement = withTimeoutOrNull(60) { tickerChannel.receive() } - println("Next element is ready in 100 ms: $nextElement") + nextElement = withTimeoutOrNull(120) { tickerChannel.receive() } + println("Next element is ready in 200 ms: $nextElement") // Emulate large consumption delays - println("Consumer pauses for 150ms") - delay(150) + println("Consumer pauses for 300ms") + delay(300) // Next element is available immediately nextElement = withTimeoutOrNull(1) { tickerChannel.receive() } println("Next element is available immediately after large consumer delay: $nextElement") // Note that the pause between `receive` calls is taken into account and next element arrives faster - nextElement = withTimeoutOrNull(60) { tickerChannel.receive() } - println("Next element is ready in 50ms after consumer pause in 150ms: $nextElement") + nextElement = withTimeoutOrNull(120) { tickerChannel.receive() } + println("Next element is ready in 100ms after consumer pause in 300ms: $nextElement") tickerChannel.cancel() // indicate that no more elements are needed } @@ -610,11 +610,11 @@ It prints following lines: ```text Initial element is available immediately: kotlin.Unit -Next element is not ready in 50 ms: null -Next element is ready in 100 ms: kotlin.Unit -Consumer pauses for 150ms +Next element is not ready in 100 ms: null +Next element is ready in 200 ms: kotlin.Unit +Consumer pauses for 300ms Next element is available immediately after large consumer delay: kotlin.Unit -Next element is ready in 50ms after consumer pause in 150ms: kotlin.Unit +Next element is ready in 100ms after consumer pause in 300ms: kotlin.Unit ``` diff --git a/kotlinx-coroutines-core/jvm/test/guide/example-channel-10.kt b/kotlinx-coroutines-core/jvm/test/guide/example-channel-10.kt index 7e2b59bf1d..8867e949ab 100644 --- a/kotlinx-coroutines-core/jvm/test/guide/example-channel-10.kt +++ b/kotlinx-coroutines-core/jvm/test/guide/example-channel-10.kt @@ -5,25 +5,25 @@ import kotlinx.coroutines.* import kotlinx.coroutines.channels.* fun main() = runBlocking { - val tickerChannel = ticker(delayMillis = 100, initialDelayMillis = 0) // create ticker channel + val tickerChannel = ticker(delayMillis = 200, initialDelayMillis = 0) // create a ticker channel var nextElement = withTimeoutOrNull(1) { tickerChannel.receive() } println("Initial element is available immediately: $nextElement") // no initial delay - nextElement = withTimeoutOrNull(50) { tickerChannel.receive() } // all subsequent elements have 100ms delay - println("Next element is not ready in 50 ms: $nextElement") + nextElement = withTimeoutOrNull(100) { tickerChannel.receive() } // all subsequent elements have 200ms delay + println("Next element is not ready in 100 ms: $nextElement") - nextElement = withTimeoutOrNull(60) { tickerChannel.receive() } - println("Next element is ready in 100 ms: $nextElement") + nextElement = withTimeoutOrNull(120) { tickerChannel.receive() } + println("Next element is ready in 200 ms: $nextElement") // Emulate large consumption delays - println("Consumer pauses for 150ms") - delay(150) + println("Consumer pauses for 300ms") + delay(300) // Next element is available immediately nextElement = withTimeoutOrNull(1) { tickerChannel.receive() } println("Next element is available immediately after large consumer delay: $nextElement") // Note that the pause between `receive` calls is taken into account and next element arrives faster - nextElement = withTimeoutOrNull(60) { tickerChannel.receive() } - println("Next element is ready in 50ms after consumer pause in 150ms: $nextElement") + nextElement = withTimeoutOrNull(120) { tickerChannel.receive() } + println("Next element is ready in 100ms after consumer pause in 300ms: $nextElement") tickerChannel.cancel() // indicate that no more elements are needed } diff --git a/kotlinx-coroutines-core/jvm/test/guide/test/ChannelsGuideTest.kt b/kotlinx-coroutines-core/jvm/test/guide/test/ChannelsGuideTest.kt index c2798a3335..97aa1da836 100644 --- a/kotlinx-coroutines-core/jvm/test/guide/test/ChannelsGuideTest.kt +++ b/kotlinx-coroutines-core/jvm/test/guide/test/ChannelsGuideTest.kt @@ -113,11 +113,11 @@ class ChannelsGuideTest { fun testExampleChannel10() { test("ExampleChannel10") { kotlinx.coroutines.guide.exampleChannel10.main() }.verifyLines( "Initial element is available immediately: kotlin.Unit", - "Next element is not ready in 50 ms: null", - "Next element is ready in 100 ms: kotlin.Unit", - "Consumer pauses for 150ms", + "Next element is not ready in 100 ms: null", + "Next element is ready in 200 ms: kotlin.Unit", + "Consumer pauses for 300ms", "Next element is available immediately after large consumer delay: kotlin.Unit", - "Next element is ready in 50ms after consumer pause in 150ms: kotlin.Unit" + "Next element is ready in 100ms after consumer pause in 300ms: kotlin.Unit" ) } } From cd696d3f8f4afdbc735915c2bded974616331b55 Mon Sep 17 00:00:00 2001 From: Dmitry Khalanskiy Date: Fri, 10 May 2024 10:01:07 +0200 Subject: [PATCH 11/11] Version 1.8.1 --- CHANGES.md | 13 +++++++++++++ README.md | 12 ++++++------ gradle.properties | 2 +- integration-testing/gradle.properties | 2 +- kotlinx-coroutines-debug/README.md | 2 +- kotlinx-coroutines-test/README.md | 2 +- ui/coroutines-guide-ui.md | 2 +- 7 files changed, 24 insertions(+), 11 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 31c8e76fb7..cf1e73e8d7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,18 @@ # Change log for kotlinx.coroutines +## Version 1.8.1 + +* Remove the `@ExperimentalTime` annotation from usages of `TimeSource` (#4046). Thanks, @hfhbd! +* Introduce a workaround for an Android bug that caused an occasional `NullPointerException` when setting the `StateFlow` value on old Android devices (#3820). +* No longer use `kotlin.random.Random` as part of `Dispatchers.Default` and `Dispatchers.IO` initialization (#4051). +* `Flow.timeout` throws the exception with which the channel was closed (#4071). +* Small tweaks and documentation fixes. + +### Changelog relative to version 1.8.1-Beta + +* `Flow.timeout` throws the exception with which the channel was closed (#4071). +* Small documentation fixes. + ## Version 1.8.1-Beta * Remove the `@ExperimentalTime` annotation from usages of `TimeSource` (#4046). Thanks, @hfhbd! diff --git a/README.md b/README.md index 3cc9f790a5..0cf3c199a2 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Kotlin Stable](https://kotl.in/badges/stable.svg)](https://kotlinlang.org/docs/components-stability.html) [![JetBrains official project](https://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub) [![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0) -[![Download](https://img.shields.io/maven-central/v/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.8.1-Beta)](https://central.sonatype.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.8.1-Beta) +[![Download](https://img.shields.io/maven-central/v/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.8.1)](https://central.sonatype.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.8.1) [![Kotlin](https://img.shields.io/badge/kotlin-1.9.21-blue.svg?logo=kotlin)](http://kotlinlang.org) [![Slack channel](https://img.shields.io/badge/chat-slack-green.svg?logo=slack)](https://kotlinlang.slack.com/messages/coroutines/) @@ -85,7 +85,7 @@ Add dependencies (you can also add other modules that you need): org.jetbrains.kotlinx kotlinx-coroutines-core - 1.8.1-Beta + 1.8.1 ``` @@ -103,7 +103,7 @@ Add dependencies (you can also add other modules that you need): ```kotlin dependencies { - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1-Beta") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1") } ``` @@ -133,7 +133,7 @@ Add [`kotlinx-coroutines-android`](ui/kotlinx-coroutines-android) module as a dependency when using `kotlinx.coroutines` on Android: ```kotlin -implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1-Beta") +implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1") ``` This gives you access to the Android [Dispatchers.Main] @@ -168,7 +168,7 @@ In common code that should get compiled for different platforms, you can add a d ```kotlin commonMain { dependencies { - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1-Beta") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1") } } ``` @@ -178,7 +178,7 @@ Platform-specific dependencies are recommended to be used only for non-multiplat #### JS Kotlin/JS version of `kotlinx.coroutines` is published as -[`kotlinx-coroutines-core-js`](https://central.sonatype.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core-js/1.8.1-Beta) +[`kotlinx-coroutines-core-js`](https://central.sonatype.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core-js/1.8.1) (follow the link to get the dependency declaration snippet). #### Native diff --git a/gradle.properties b/gradle.properties index ef0764dc37..59063db89b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Kotlin -version=1.8.1-Beta-SNAPSHOT +version=1.8.1-SNAPSHOT group=org.jetbrains.kotlinx kotlin_version=1.9.21 # DO NOT rename this property without adapting kotlinx.train build chain: diff --git a/integration-testing/gradle.properties b/integration-testing/gradle.properties index 3813e13826..af5497e453 100644 --- a/integration-testing/gradle.properties +++ b/integration-testing/gradle.properties @@ -1,5 +1,5 @@ kotlin_version=1.9.21 -coroutines_version=1.8.1-Beta-SNAPSHOT +coroutines_version=1.8.1-SNAPSHOT asm_version=9.3 kotlin.code.style=official diff --git a/kotlinx-coroutines-debug/README.md b/kotlinx-coroutines-debug/README.md index a2124ab109..24a2fa8d7b 100644 --- a/kotlinx-coroutines-debug/README.md +++ b/kotlinx-coroutines-debug/README.md @@ -61,7 +61,7 @@ stacktraces will be dumped to the console. ### Using as JVM agent Debug module can also be used as a standalone JVM agent to enable debug probes on the application startup. -You can run your application with an additional argument: `-javaagent:kotlinx-coroutines-debug-1.8.1-Beta.jar`. +You can run your application with an additional argument: `-javaagent:kotlinx-coroutines-debug-1.8.1.jar`. Additionally, on Linux and Mac OS X you can use `kill -5 $pid` command in order to force your application to print all alive coroutines. When used as Java agent, `"kotlinx.coroutines.debug.enable.creation.stack.trace"` system property can be used to control [DebugProbes.enableCreationStackTraces] along with agent startup. diff --git a/kotlinx-coroutines-test/README.md b/kotlinx-coroutines-test/README.md index 0633e6f235..fbadf574d6 100644 --- a/kotlinx-coroutines-test/README.md +++ b/kotlinx-coroutines-test/README.md @@ -26,7 +26,7 @@ Provided [TestDispatcher] implementations: Add `kotlinx-coroutines-test` to your project test dependencies: ``` dependencies { - testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.1-Beta' + testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.1' } ``` diff --git a/ui/coroutines-guide-ui.md b/ui/coroutines-guide-ui.md index 93c0f1a0bd..3b2087d677 100644 --- a/ui/coroutines-guide-ui.md +++ b/ui/coroutines-guide-ui.md @@ -110,7 +110,7 @@ Add dependencies on `kotlinx-coroutines-android` module to the `dependencies { . `app/build.gradle` file: ```groovy -implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1-Beta" +implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1" ``` You can clone [kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) project from GitHub onto your