@@ -37,6 +37,15 @@ Top-level suspending functions:
37
37
| [ run] | Switches to a different context
38
38
| [ withTimeout] | Set execution time-limit (deadline)
39
39
40
+ [ Select] [ kotlinx.coroutines.experimental.selects.select ] expression waits for the result of multiple suspending functions simultaneously:
41
+
42
+ | ** Receiver** | ** Suspending function** | ** Select clause** | ** Non-suspending version**
43
+ | ---------------- | --------------------------------------------- | ------------------------------------------------ | --------------------------
44
+ | [ Deferred] | [ await] [ Deferred.await ] | [ onAwait] [ SelectBuilder.onAwait ] | [ isCompleted] [ Deferred.isCompleted ]
45
+ | [ SendChannel] | [ send] [ SendChannel.send ] | [ onSend] [ SelectBuilder.onSend ] | [ offer] [ SendChannel.offer ]
46
+ | [ ReceiveChannel] | [ receive] [ ReceiveChannel.receive ] | [ onReceive] [ SelectBuilder.onReceive ] | [ poll] [ ReceiveChannel.poll ]
47
+ | [ ReceiveChannel] | [ receiveOrNull] [ ReceiveChannel.receiveOrNull ] | [ onReceiveOrNull] [ SelectBuilder.onReceiveOrNull ] | [ poll] [ ReceiveChannel.poll ]
48
+
40
49
Cancellation support for user-defined suspending functions is available with [ suspendCancellableCoroutine]
41
50
helper function. [ NonCancellable] job object is provided to suppress cancellation with
42
51
` run(NonCancellable) {...} ` block of code.
@@ -45,43 +54,57 @@ This module provides debugging facilities for coroutines (run JVM with `-ea` or
45
54
and [ newCoroutineContext] function to write user-defined coroutine builders that work with these
46
55
debugging facilities.
47
56
57
+ # Package kotlinx.coroutines.experimental
58
+
59
+ General-purpose coroutine builders, contexts, and helper functions.
60
+
61
+ # Package kotlinx.coroutines.experimental.channels
62
+
63
+ Channels -- non-blocking primitives for communicating a stream of elements between coroutines.
64
+
65
+ # Package kotlinx.coroutines.experimental.selects
66
+
67
+ Select expression to perform multiple suspending operations simultaneously until one of them succeeds.
68
+
48
69
<!-- - SITE_ROOT https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core -->
49
70
<!-- - DOCS_ROOT kotlinx-coroutines-core/target/dokka/kotlinx-coroutines-core -->
50
71
<!-- - INDEX kotlinx.coroutines.experimental -->
51
- [ CommonPool ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-common-pool/index .html
52
- [ CoroutineDispatcher ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-coroutine-dispatcher /index.html
72
+ [ launch ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/launch .html
73
+ [ Job ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-job /index.html
53
74
[ CoroutineScope ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-coroutine-scope/index.html
75
+ [ async ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/async.html
54
76
[ Deferred ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-deferred/index.html
55
- [ Job ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-job/index.html
56
- [ Mutex ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-mutex/index.html
57
- [ Mutex.lock ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-mutex/lock.html
58
- [ NonCancellable ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-non-cancellable/index.html
77
+ [ runBlocking ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/run-blocking.html
78
+ [ CoroutineDispatcher ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-coroutine-dispatcher/index.html
79
+ [ CommonPool ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-common-pool/index.html
80
+ [ newSingleThreadContext ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/new-single-thread-context.html
81
+ [ newFixedThreadPoolContext ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/new-fixed-thread-pool-context.html
82
+ [ java.util.concurrent.Executor.toCoroutineDispatcher ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/to-coroutine-dispatcher.html
59
83
[ Unconfined ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-unconfined/index.html
60
- [ java.util.concurrent.Executor.toCoroutineDispatcher ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/java.util.concurrent.-executor/to-coroutine-dispatcher .html
61
- [ async ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/async .html
84
+ [ Mutex ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-mutex/index .html
85
+ [ Mutex.lock ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/lock .html
62
86
[ delay ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/delay.html
63
- [ launch ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/launch.html
64
- [ newCoroutineContext ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/new-coroutine-context.html
65
- [ newFixedThreadPoolContext ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/new-fixed-thread-pool-context.html
66
- [ newSingleThreadContext ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/new-single-thread-context.html
87
+ [ yield ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/yield.html
67
88
[ run ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/run.html
68
- [ runBlocking ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/run-blocking.html
69
- [ suspendCancellableCoroutine ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/suspend-cancellable-coroutine.html
70
89
[ withTimeout ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/with-timeout.html
71
- [ yield ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/yield.html
90
+ [ suspendCancellableCoroutine ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/suspend-cancellable-coroutine.html
91
+ [ NonCancellable ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/-non-cancellable/index.html
92
+ [ newCoroutineContext ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/new-coroutine-context.html
72
93
<!-- - INDEX kotlinx.coroutines.experimental.channels -->
73
- [ Channel ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-channel/index .html
94
+ [ produce ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/produce .html
74
95
[ ProducerJob ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-producer-job/index.html
75
96
[ ProducerScope ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-producer-scope/index.html
76
- [ ReceiveChannel.receive ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-receive-channel/receive.html
77
- [ SendChannel.send ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-send-channel/send.html
78
- [ produce ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/produce.html
97
+ [ Channel ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-channel/index.html
98
+ [ SendChannel.send ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/send.html
99
+ [ ReceiveChannel.receive ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/receive.html
100
+ [ SendChannel ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-send-channel/index.html
101
+ [ SendChannel.offer ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/offer.html
102
+ [ ReceiveChannel ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-receive-channel/index.html
103
+ [ ReceiveChannel.poll ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/poll.html
104
+ [ ReceiveChannel.receiveOrNull ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/receive-or-null.html
105
+ <!-- - INDEX kotlinx.coroutines.experimental.selects -->
106
+ [ kotlinx.coroutines.experimental.selects.select ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.selects/select.html
107
+ [ SelectBuilder.onSend ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.selects/on-send.html
108
+ [ SelectBuilder.onReceive ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.selects/on-receive.html
109
+ [ SelectBuilder.onReceiveOrNull ] : https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.selects/on-receive-or-null.html
79
110
<!-- - END -->
80
-
81
- # Package kotlinx.coroutines.experimental
82
-
83
- General-purpose coroutine builders, contexts, and helper functions.
84
-
85
- # Package kotlinx.coroutines.experimental.channels
86
-
87
- Channels -- non-blocking primitives for communicating a stream of elements between coroutines.
0 commit comments