@@ -8,6 +8,8 @@ Coroutine builder functions:
8
8
| ------------- | ------------- | ---------------- | ---------------
9
9
| [ launch] | [ Job] | [ CoroutineScope] | Launches coroutine that does not have any result
10
10
| [ async] | [ Deferred] | [ CoroutineScope] | Returns a single value with the future result
11
+ | [ produce] [ kotlinx.coroutines.experimental.channels.produce ] | [ ReceiveChannel] [ kotlinx.coroutines.experimental.channels.ReceiveChannel ] | [ ProducerScope] [ kotlinx.coroutines.experimental.channels.ProducerScope ] | Produces a stream of elements
12
+
11
13
12
14
Coroutine dispatchers implementing [ CoroutineDispatcher] :
13
15
@@ -23,6 +25,14 @@ More context elements:
23
25
| [ NonCancellable] | A non-cancelable job that is always active
24
26
| [ CoroutineExceptionHandler] | Handler for uncaught exception
25
27
28
+ Synchronization primitives for coroutines:
29
+
30
+ | ** Name** | ** Suspending functions** | ** Description**
31
+ | ---------- | ----------------------------------------------------------- | ---------------
32
+ | [ Mutex] [ kotlinx.coroutines.experimental.sync.Mutex ] | [ lock] [ kotlinx.coroutines.experimental.sync.Mutex.lock ] | Mutual exclusion
33
+ | [ Channel] [ kotlinx.coroutines.experimental.channels.Channel ] | [ send] [ kotlinx.coroutines.experimental.channels.SendChannel.send ] , [ receive] [ kotlinx.coroutines.experimental.channels.ReceiveChannel.receive ] | Communication channel (aka queue or exchanger)
34
+
35
+
26
36
Top-level suspending functions:
27
37
28
38
| ** Name** | ** Description**
@@ -37,6 +47,19 @@ Cancellation support for user-defined suspending functions is available with [su
37
47
helper function. [ NonCancellable] job object is provided to suppress cancellation with
38
48
` run(NonCancellable) {...} ` block of code.
39
49
50
+ [ Select] [ kotlinx.coroutines.experimental.selects.select ] expression waits for the result of multiple suspending functions simultaneously:
51
+
52
+ | ** Receiver** | ** Suspending function** | ** Select clause** | ** Non-suspending version**
53
+ | ---------------- | --------------------------------------------- | ------------------------------------------------ | --------------------------
54
+ | [ Job] | [ join] [ Job.join ] | [ onJoin] [ Job.onJoin ] | [ isCompleted] [ Job.isCompleted ]
55
+ | [ Deferred] | [ await] [ Deferred.await ] | [ onAwait] [ Deferred.onAwait ] | [ isCompleted] [ Job.isCompleted ]
56
+ | [ SendChannel] [ kotlinx.coroutines.experimental.channels.SendChannel ] | [ send] [ kotlinx.coroutines.experimental.channels.SendChannel.send ] | [ onSend] [ kotlinx.coroutines.experimental.channels.SendChannel.onSend ] | [ offer] [ kotlinx.coroutines.experimental.channels.SendChannel.offer ]
57
+ | [ ReceiveChannel] [ kotlinx.coroutines.experimental.channels.ReceiveChannel ] | [ receive] [ kotlinx.coroutines.experimental.channels.ReceiveChannel.receive ] | [ onReceive] [ kotlinx.coroutines.experimental.channels.ReceiveChannel.onReceive ] | [ poll] [ kotlinx.coroutines.experimental.channels.ReceiveChannel.poll ]
58
+ | [ ReceiveChannel] [ kotlinx.coroutines.experimental.channels.ReceiveChannel ] | [ receiveOrNull] [ kotlinx.coroutines.experimental.channels.ReceiveChannel.receiveOrNull ] | [ onReceiveOrNull] [ kotlinx.coroutines.experimental.channels.ReceiveChannel.onReceiveOrNull ] | [ poll] [ kotlinx.coroutines.experimental.channels.ReceiveChannel.poll ]
59
+ | [ Mutex] [ kotlinx.coroutines.experimental.sync.Mutex ] | [ lock] [ kotlinx.coroutines.experimental.sync.Mutex.lock ] | [ onLock] [ kotlinx.coroutines.experimental.sync.Mutex.onLock ] | [ tryLock] [ kotlinx.coroutines.experimental.sync.Mutex.tryLock ]
60
+ | none | [ delay] | [ onTimeout] [ kotlinx.coroutines.experimental.selects.SelectBuilder.onTimeout ] | none
61
+
62
+
40
63
# Package kotlinx.coroutines.experimental
41
64
42
65
General-purpose coroutine builders, contexts, and helper functions.
@@ -59,4 +82,31 @@ General-purpose coroutine builders, contexts, and helper functions.
59
82
[ withTimeout ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/with-timeout.html
60
83
[ withTimeoutOrNull ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/with-timeout-or-null.html
61
84
[ suspendCancellableCoroutine ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/suspend-cancellable-coroutine.html
85
+ [ Job.join ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-job/join.html
86
+ [ Job.onJoin ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-job/on-join.html
87
+ [ Job.isCompleted ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-job/is-completed.html
88
+ [ Deferred.await ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-deferred/await.html
89
+ [ Deferred.onAwait ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-deferred/on-await.html
90
+ <!-- - INDEX kotlinx.coroutines.experimental.sync -->
91
+ [ kotlinx.coroutines.experimental.sync.Mutex ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.sync/-mutex/index.html
92
+ [ kotlinx.coroutines.experimental.sync.Mutex.lock ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.sync/-mutex/lock.html
93
+ [ kotlinx.coroutines.experimental.sync.Mutex.onLock ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.sync/-mutex/on-lock.html
94
+ [ kotlinx.coroutines.experimental.sync.Mutex.tryLock ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.sync/-mutex/try-lock.html
95
+ <!-- - INDEX kotlinx.coroutines.experimental.channels -->
96
+ [ kotlinx.coroutines.experimental.channels.produce ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/produce.html
97
+ [ kotlinx.coroutines.experimental.channels.ReceiveChannel ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-receive-channel/index.html
98
+ [ kotlinx.coroutines.experimental.channels.ProducerScope ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-producer-scope/index.html
99
+ [ kotlinx.coroutines.experimental.channels.Channel ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-channel/index.html
100
+ [ kotlinx.coroutines.experimental.channels.SendChannel.send ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-send-channel/send.html
101
+ [ kotlinx.coroutines.experimental.channels.ReceiveChannel.receive ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-receive-channel/receive.html
102
+ [ kotlinx.coroutines.experimental.channels.SendChannel ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-send-channel/index.html
103
+ [ kotlinx.coroutines.experimental.channels.SendChannel.onSend ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-send-channel/on-send.html
104
+ [ kotlinx.coroutines.experimental.channels.SendChannel.offer ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-send-channel/offer.html
105
+ [ kotlinx.coroutines.experimental.channels.ReceiveChannel.onReceive ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-receive-channel/on-receive.html
106
+ [ kotlinx.coroutines.experimental.channels.ReceiveChannel.poll ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-receive-channel/poll.html
107
+ [ kotlinx.coroutines.experimental.channels.ReceiveChannel.receiveOrNull ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-receive-channel/receive-or-null.html
108
+ [ kotlinx.coroutines.experimental.channels.ReceiveChannel.onReceiveOrNull ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-receive-channel/on-receive-or-null.html
109
+ <!-- - INDEX kotlinx.coroutines.experimental.selects -->
110
+ [ kotlinx.coroutines.experimental.selects.select ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.selects/select.html
111
+ [ kotlinx.coroutines.experimental.selects.SelectBuilder.onTimeout ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.selects/-select-builder/on-timeout.html
62
112
<!-- - END -->
0 commit comments