2
2
3
3
[ ![ official JetBrains project] ( https://jb.gg/badges/official.svg )] ( https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub )
4
4
[ ![ GitHub license] ( https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat )] ( https://www.apache.org/licenses/LICENSE-2.0 )
5
- [ ![ Download] ( https://api.bintray.com/packages/kotlin/kotlinx/kotlinx.coroutines/images/download.svg?version=1.4.2 ) ] ( https://bintray.com/kotlin/kotlinx/kotlinx.coroutines/1.4.2 )
6
- [ ![ Kotlin] ( https://img.shields.io/badge/kotlin-1.4.0 -blue.svg?logo=kotlin )] ( http://kotlinlang.org )
5
+ [ ![ Download] ( https://api.bintray.com/packages/kotlin/kotlinx/kotlinx.coroutines/images/download.svg?version=1.4.3 ) ] ( https://bintray.com/kotlin/kotlinx/kotlinx.coroutines/1.4.3 )
6
+ [ ![ Kotlin] ( https://img.shields.io/badge/kotlin-1.4.30 -blue.svg?logo=kotlin )] ( http://kotlinlang.org )
7
7
[ ![ Slack channel] ( https://img.shields.io/badge/chat-slack-green.svg?logo=slack )] ( https://kotlinlang.slack.com/messages/coroutines/ )
8
8
9
9
Library support for Kotlin coroutines with [ multiplatform] ( #multiplatform ) support.
10
- This is a companion version for Kotlin ` 1.4.0 ` release.
10
+ This is a companion version for Kotlin ` 1.4.30 ` release.
11
11
12
12
``` kotlin
13
13
suspend fun main () = coroutineScope {
@@ -45,6 +45,7 @@ suspend fun main() = coroutineScope {
45
45
* [ debug] ( kotlinx-coroutines-debug/README.md ) &mdash ; debug utilities for coroutines:
46
46
* [ DebugProbes] API to probe, keep track of, print and dump active coroutines;
47
47
* [ CoroutinesTimeout] test rule to automatically dump coroutines on test timeout.
48
+ * Automatic integration with [ BlockHound] ( https://github.com/reactor/BlockHound ) .
48
49
* [ reactive] ( reactive/README.md ) &mdash ; modules that provide builders and iteration support for various reactive streams libraries:
49
50
* Reactive Streams ([ Publisher.collect] , [ Publisher.awaitSingle] , [ kotlinx.coroutines.reactive.publish] , etc),
50
51
* Flow (JDK 9) (the same interface as for Reactive Streams),
@@ -86,15 +87,15 @@ Add dependencies (you can also add other modules that you need):
86
87
<dependency >
87
88
<groupId >org.jetbrains.kotlinx</groupId >
88
89
<artifactId >kotlinx-coroutines-core</artifactId >
89
- <version >1.4.2 </version >
90
+ <version >1.4.3 </version >
90
91
</dependency >
91
92
```
92
93
93
94
And make sure that you use the latest Kotlin version:
94
95
95
96
``` xml
96
97
<properties >
97
- <kotlin .version>1.4.0 </kotlin .version>
98
+ <kotlin .version>1.4.30 </kotlin .version>
98
99
</properties >
99
100
```
100
101
@@ -104,23 +105,23 @@ Add dependencies (you can also add other modules that you need):
104
105
105
106
``` groovy
106
107
dependencies {
107
- implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2 '
108
+ implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3 '
108
109
}
109
110
```
110
111
111
112
And make sure that you use the latest Kotlin version:
112
113
113
114
``` groovy
114
115
buildscript {
115
- ext.kotlin_version = '1.4.0 '
116
+ ext.kotlin_version = '1.4.30 '
116
117
}
117
118
```
118
119
119
- Make sure that you have either ` jcenter() ` or ` mavenCentral() ` in the list of repositories:
120
+ Make sure that you have ` mavenCentral() ` in the list of repositories:
120
121
121
122
```
122
123
repository {
123
- jcenter ()
124
+ mavenCentral ()
124
125
}
125
126
```
126
127
@@ -130,51 +131,38 @@ Add dependencies (you can also add other modules that you need):
130
131
131
132
``` groovy
132
133
dependencies {
133
- implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2 ")
134
+ implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3 ")
134
135
}
135
136
```
136
137
137
138
And make sure that you use the latest Kotlin version:
138
139
139
140
``` groovy
140
141
plugins {
141
- kotlin("jvm") version "1.4.0 "
142
+ kotlin("jvm") version "1.4.30 "
142
143
}
143
144
```
144
145
145
- Make sure that you have either ` jcenter() ` or ` mavenCentral() ` in the list of repositories.
146
-
147
- ### Multiplatform
148
-
149
- Core modules of ` kotlinx.coroutines ` are also available for
150
- [ Kotlin/JS] ( #js ) and [ Kotlin/Native] ( #native ) .
151
- In common code that should get compiled for different platforms, you can add dependency to ` kotlinx-coroutines-core ` right to the ` commonMain ` source set:
152
- ``` groovy
153
- commonMain {
154
- dependencies {
155
- implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2")
156
- }
157
- }
158
- ```
146
+ Make sure that you have ` mavenCentral() ` in the list of repositories.
159
147
160
148
### Android
161
149
162
150
Add [ ` kotlinx-coroutines-android ` ] ( ui/kotlinx-coroutines-android )
163
151
module as dependency when using ` kotlinx.coroutines ` on Android:
164
152
165
153
``` groovy
166
- implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.2 '
154
+ implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3 '
167
155
```
168
156
169
157
This gives you access to Android [ Dispatchers.Main]
170
158
coroutine dispatcher and also makes sure that in case of crashed coroutine with unhandled exception this
171
- exception is logged before crashing Android application, similarly to the way uncaught exceptions in
172
- threads are handled by Android runtime.
159
+ exception is logged before crashing Android application, similarly to the way uncaught exceptions in
160
+ threads are handled by Android runtime.
173
161
174
162
#### R8 and ProGuard
175
163
176
164
R8 and ProGuard rules are bundled into the [ ` kotlinx-coroutines-android ` ] ( ui/kotlinx-coroutines-android ) module.
177
- For more details see [ "Optimization" section for Android] ( ui/kotlinx-coroutines-android/README.md#optimization ) .
165
+ For more details see [ "Optimization" section for Android] ( ui/kotlinx-coroutines-android/README.md#optimization ) .
178
166
179
167
#### Avoiding including the debug infrastructure in the resulting APK
180
168
@@ -187,27 +175,40 @@ packagingOptions {
187
175
}
188
176
```
189
177
190
- ### JS
178
+ ### Multiplatform
191
179
192
- [ Kotlin/JS] ( https://kotlinlang.org/docs/js-overview.html ) version of ` kotlinx.coroutines ` is published as
193
- [ ` kotlinx-coroutines-core-js ` ] ( https://search.maven.org/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core-js/1.4.2/jar )
194
- (follow the link to get the dependency declaration snippet).
195
-
196
- You can also use [ ` kotlinx-coroutines-core ` ] ( https://www.npmjs.com/package/kotlinx-coroutines-core ) package via NPM.
180
+ Core modules of ` kotlinx.coroutines ` are also available for
181
+ [ Kotlin/JS] ( https://kotlinlang.org/docs/reference/js-overview.html ) and [ Kotlin/Native] ( https://kotlinlang.org/docs/reference/native-overview.html ) .
197
182
198
- ### Native
183
+ In common code that should get compiled for different platforms, you can add dependency to ` kotlinx-coroutines-core ` right to the ` commonMain ` source set:
184
+ ``` groovy
185
+ commonMain {
186
+ dependencies {
187
+ implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3")
188
+ }
189
+ }
190
+ ```
199
191
200
- [ Kotlin/Native] ( https://kotlinlang.org/docs/native-overview.html ) version of ` kotlinx.coroutines ` is published as
201
- [ ` kotlinx-coroutines-core-native ` ] ( https://search.maven.org/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core-native/1.4.2/jar )
202
- (follow the link to get the dependency declaration snippet).
192
+ No more additional dependencies is needed, platform-specific artifacts will be resolved automatically via Gradle metadata available since Gradle 5.3.
203
193
204
- Only single-threaded code (JS-style) on Kotlin/Native is currently supported.
205
- Kotlin/Native supports only Gradle version 4.10 and you need to enable Gradle metadata in your
206
- ` settings.gradle ` file:
194
+ Platform-specific dependencies are recommended to be used only for non-multiplatform projects that are compiled only for target platform.
207
195
208
- ``` groovy
209
- enableFeaturePreview('GRADLE_METADATA')
210
- ```
196
+ #### JS
197
+
198
+ Kotlin/JS version of ` kotlinx.coroutines ` is published as
199
+ [ ` kotlinx-coroutines-core-js ` ] ( https://search.maven.org/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core-js/1.4.3/jar )
200
+ (follow the link to get the dependency declaration snippet) and as [ ` kotlinx-coroutines-core ` ] ( https://www.npmjs.com/package/kotlinx-coroutines-core ) NPM package.
201
+
202
+ #### Native
203
+
204
+ Kotlin/Native version of ` kotlinx.coroutines ` is published as
205
+ [ ` kotlinx-coroutines-core-$platform ` ] ( https://mvnrepository.com/search?q=kotlinx-coroutines-core- ) where ` $platform ` is
206
+ the target Kotlin/Native platform. [ List of currently supported targets] ( https://github.com/Kotlin/kotlinx.coroutines/blob/master/gradle/compile-native-multiplatform.gradle#L16 ) .
207
+
208
+
209
+ Only single-threaded code (JS-style) on Kotlin/Native is supported in stable versions.
210
+ Additionally, special ` -native-mt ` version is released on a regular basis, for the state of multi-threaded coroutines support
211
+ please follow the [ corresponding issue] ( https://github.com/Kotlin/kotlinx.coroutines/issues/462 ) for the additional details.
211
212
212
213
Since Kotlin/Native does not generally provide binary compatibility between versions,
213
214
you should use the same version of Kotlin/Native compiler as was used to build ` kotlinx.coroutines ` .
@@ -218,6 +219,7 @@ See [Contributing Guidelines](CONTRIBUTING.md).
218
219
219
220
<!-- - MODULE kotlinx-coroutines-core -->
220
221
<!-- - INDEX kotlinx.coroutines -->
222
+
221
223
[ launch ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/launch.html
222
224
[ async ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/async.html
223
225
[ Job ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-job/index.html
@@ -239,52 +241,81 @@ See [Contributing Guidelines](CONTRIBUTING.md).
239
241
[ Promise.await ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/kotlin.js.-promise/await.html
240
242
[ promise ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/promise.html
241
243
[ Window.asCoroutineDispatcher ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/org.w3c.dom.-window/as-coroutine-dispatcher.html
244
+
242
245
<!-- - INDEX kotlinx.coroutines.flow -->
246
+
243
247
[ Flow ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html
244
248
[ _flow ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/flow.html
245
249
[ filter ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/filter.html
246
250
[ map ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/map.html
251
+
247
252
<!-- - INDEX kotlinx.coroutines.channels -->
253
+
248
254
[ Channel ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.channels/-channel/index.html
255
+
249
256
<!-- - INDEX kotlinx.coroutines.selects -->
257
+
250
258
[ select ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.selects/select.html
259
+
251
260
<!-- - INDEX kotlinx.coroutines.sync -->
261
+
252
262
[ Mutex ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.sync/-mutex/index.html
253
263
[ Semaphore ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.sync/-semaphore/index.html
264
+
254
265
<!-- - MODULE kotlinx-coroutines-test -->
255
266
<!-- - INDEX kotlinx.coroutines.test -->
267
+
256
268
[ Dispatchers.setMain ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-test/kotlinx.coroutines.test/kotlinx.coroutines.-dispatchers/set-main.html
257
269
[ TestCoroutineScope ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-test/kotlinx.coroutines.test/-test-coroutine-scope/index.html
270
+
258
271
<!-- - MODULE kotlinx-coroutines-debug -->
259
272
<!-- - INDEX kotlinx.coroutines.debug -->
273
+
260
274
[ DebugProbes ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-debug/kotlinx.coroutines.debug/-debug-probes/index.html
275
+
261
276
<!-- - INDEX kotlinx.coroutines.debug.junit4 -->
277
+
262
278
[ CoroutinesTimeout ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-debug/kotlinx.coroutines.debug.junit4/-coroutines-timeout/index.html
279
+
263
280
<!-- - MODULE kotlinx-coroutines-slf4j -->
264
281
<!-- - INDEX kotlinx.coroutines.slf4j -->
282
+
265
283
[ MDCContext ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-slf4j/kotlinx.coroutines.slf4j/-m-d-c-context/index.html
284
+
266
285
<!-- - MODULE kotlinx-coroutines-jdk8 -->
267
286
<!-- - INDEX kotlinx.coroutines.future -->
287
+
268
288
[ CompletionStage.await ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-jdk8/kotlinx.coroutines.future/java.util.concurrent.-completion-stage/await.html
289
+
269
290
<!-- - MODULE kotlinx-coroutines-guava -->
270
291
<!-- - INDEX kotlinx.coroutines.guava -->
292
+
271
293
[ ListenableFuture.await ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-guava/kotlinx.coroutines.guava/com.google.common.util.concurrent.-listenable-future/await.html
294
+
272
295
<!-- - MODULE kotlinx-coroutines-play-services -->
273
296
<!-- - INDEX kotlinx.coroutines.tasks -->
297
+
274
298
[ Task.await ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-play-services/kotlinx.coroutines.tasks/com.google.android.gms.tasks.-task/await.html
299
+
275
300
<!-- - MODULE kotlinx-coroutines-reactive -->
276
301
<!-- - INDEX kotlinx.coroutines.reactive -->
302
+
277
303
[ Publisher.collect ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-reactive/kotlinx.coroutines.reactive/org.reactivestreams.-publisher/collect.html
278
304
[ Publisher.awaitSingle ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-reactive/kotlinx.coroutines.reactive/org.reactivestreams.-publisher/await-single.html
279
305
[ kotlinx.coroutines.reactive.publish ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-reactive/kotlinx.coroutines.reactive/publish.html
306
+
280
307
<!-- - MODULE kotlinx-coroutines-rx2 -->
281
308
<!-- - INDEX kotlinx.coroutines.rx2 -->
309
+
282
310
[ rxFlowable ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx2/kotlinx.coroutines.rx2/rx-flowable.html
283
311
[ rxSingle ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx2/kotlinx.coroutines.rx2/rx-single.html
312
+
284
313
<!-- - MODULE kotlinx-coroutines-rx2 -->
285
314
<!-- - INDEX kotlinx.coroutines.rx2 -->
286
315
<!-- - MODULE kotlinx-coroutines-reactor -->
287
316
<!-- - INDEX kotlinx.coroutines.reactor -->
317
+
288
318
[ flux ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-reactor/kotlinx.coroutines.reactor/flux.html
289
319
[ mono ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-reactor/kotlinx.coroutines.reactor/mono.html
320
+
290
321
<!-- - END -->
0 commit comments