@@ -4,18 +4,21 @@ Library support for Kotlin coroutines. This is a companion version for Kotlin 1.
4
4
It contains worked-out implementation of coroutine builders, suspending functions, and contexts that are
5
5
used as examples in
6
6
[ Kotlin coroutines design document] ( https://github.com/Kotlin/kotlin-coroutines/blob/master/kotlin-coroutines-informal.md )
7
+
8
+ See [ change log] ( CHANGES.md ) for a summary of changes between releases.
7
9
8
10
It consists of the following modules:
9
11
10
12
* ` kotlinx-coroutines-core ` module with core primitives to work with coroutines. It is designed to work on any JDK6+ and Android
11
13
and contains the following main pieces:
12
14
* ` launch(context) { ... } ` to start a coroutine in the given context.
13
15
* ` run(context) { ... } ` to switch to a different context inside a coroutine.
14
- * ` runBlocking(context) { ... } ` to use asynchronous Kotlin APIs from a thread-blocking code.
16
+ * ` runBlocking { ... } ` to use asynchronous Kotlin APIs from a thread-blocking code.
15
17
* ` defer(context) { ... } ` to get a deferred result of coroutine execution in a non-blocking way.
16
18
* ` delay(...) ` for a non-blocking sleep in coroutines.
17
- * ` Here ` and ` CommonPool ` contexts.
18
- * ` newSingleThreadContext(...) ` and ` newFixedThreadPoolContext(...) ` functions.
19
+ * ` Here ` and ` CommonPool ` contexts, ` context ` or a parent coroutine.
20
+ * ` newSingleThreadContext(...) ` and ` newFixedThreadPoolContext(...) ` functions,
21
+ ` Executor.toCoroutineDispatcher() ` extension.
19
22
* Cancellation support with ` Job ` interface and ` suspendCancellableCoroutine ` helper function.
20
23
* Debugging facilities for coroutines (run JVM with ` -ea ` or ` -Dkotlinx.coroutines.debug ` options) and
21
24
` newCoroutineContext(context) ` function to write user-defined coroutine builders that work with these
@@ -25,7 +28,7 @@ and contains the following main pieces:
25
28
* ` future { ... } ` coroutine builder that returns ` CompletableFuture ` and works in ` CommonPool ` context by default.
26
29
* ` .await() ` suspending function for ` CompletableFuture ` .
27
30
28
- * ` kotlinx-coroutines-nio ` module with extensions for asynchronous IO on JDK7+ (does not support cancellation yet) .
31
+ * ` kotlinx-coroutines-nio ` module with extensions for asynchronous IO on JDK7+.
29
32
30
33
* ` kotlinx-coroutines-swing ` module with ` Swing ` context for Swing UI applications.
31
34
@@ -66,7 +69,7 @@ Add dependencies (you can also add other modules that you need):
66
69
<dependency >
67
70
<groupId >org.jetbrains.kotlinx</groupId >
68
71
<artifactId >kotlinx-coroutines-core</artifactId >
69
- <version >0.3 -beta</version >
72
+ <version >0.4 -beta</version >
70
73
</dependency >
71
74
```
72
75
@@ -93,7 +96,7 @@ repositories {
93
96
Add dependencies (you can also add other modules that you need):
94
97
95
98
``` groovy
96
- compile 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.3 -beta'
99
+ compile 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.4 -beta'
97
100
```
98
101
99
102
And make sure that you use the right Kotlin version:
0 commit comments