Skip to content

Commit 89f8c69

Browse files
committed
Minor documentation improvements
1 parent bf33052 commit 89f8c69

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

kotlinx-coroutines-core/common/src/CoroutineScope.kt

+12-15
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,13 @@ public operator fun CoroutineScope.plus(context: CoroutineContext): CoroutineSco
7373
* Example of use:
7474
* ```
7575
* class MyAndroidActivity {
76-
* private val scope = MainScope()
76+
* private val scope = MainScope()
7777
*
78-
* override fun onDestroy() {
79-
* super.onDestroy()
80-
* scope.cancel()
81-
* }
78+
* override fun onDestroy() {
79+
* super.onDestroy()
80+
* scope.cancel()
81+
* }
8282
* }
83-
*
8483
* ```
8584
*
8685
* The resulting scope has [SupervisorJob] and [Dispatchers.Main] context elements.
@@ -128,7 +127,6 @@ public val CoroutineScope.isActive: Boolean
128127
* send(Math.sqrt(number))
129128
* }
130129
* }
131-
*
132130
* ```
133131
*/
134132
public object GlobalScope : CoroutineScope {
@@ -151,16 +149,15 @@ public object GlobalScope : CoroutineScope {
151149
*
152150
* ```
153151
* suspend fun showSomeData() = coroutineScope {
154-
*
155-
* val data = async(Dispatchers.IO) { // <- extension on current scope
152+
* val data = async(Dispatchers.IO) { // <- extension on current scope
156153
* ... load some UI data for the Main thread ...
157-
* }
154+
* }
158155
*
159-
* withContext(Dispatchers.Main) {
160-
* doSomeWork()
161-
* val result = data.await()
162-
* display(result)
163-
* }
156+
* withContext(Dispatchers.Main) {
157+
* doSomeWork()
158+
* val result = data.await()
159+
* display(result)
160+
* }
164161
* }
165162
* ```
166163
*

kotlinx-coroutines-core/common/src/flow/Builders.kt

+3
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,9 @@ public fun <T> channelFlow(@BuilderInference block: suspend ProducerScope<T>.()
291291
* awaitClose { api.unregister(callback) }
292292
* }
293293
* ```
294+
*
295+
* This function is an alias for [channelFlow], it has a separate name to reflect
296+
* the intent of the usage (integration with a callback-based API) better.
294297
*/
295298
@Suppress("NOTHING_TO_INLINE")
296299
@ExperimentalCoroutinesApi

kotlinx-coroutines-debug/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Do not use this module in production environment and do not rely on the format o
136136

137137
Unfortunately, Android runtime does not support Instrument API necessary for `kotlinx-coroutines-debug` to function, triggering `java.lang.NoClassDefFoundError: Failed resolution of: Ljava/lang/management/ManagementFactory;`.
138138

139-
Nevertheless, it will be possible to support debug agent on Android as soon as [GradleAspectJ-Android](https://github.com/Archinamon/android-gradle-aspectj) will support androin-gradle 3.3
139+
Nevertheless, it will be possible to support debug agent on Android as soon as [GradleAspectJ-Android](https://github.com/Archinamon/android-gradle-aspectj) will support android-gradle 3.3
140140

141141
<!---
142142
Make an exception googlable

0 commit comments

Comments
 (0)