You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* to automatically propagate both context elements and cancellation.
16
16
*
17
17
* The best ways to obtain a standalone instance of the scope are [CoroutineScope()] and [MainScope()] factory functions.
18
-
* Additional context elements can be appended to the scope using [plus][CoroutineScope.plus] operator.
18
+
* Additional context elements can be appended to the scope using the [plus][CoroutineScope.plus] operator.
19
19
*
20
20
* Manual implementation of this interface is not recommended, implementation by delegation should be preferred instead.
21
-
* By convention, [context of the scope][CoroutineScope.coroutineContext] should contain an instance of a [job][Job] to enforce structured concurrency.
21
+
* By convention, the [context of a scope][CoroutineScope.coroutineContext] should contain an instance of a [job][Job] to enforce structured concurrency.
22
22
*
23
23
* Every coroutine builder (like [launch][CoroutineScope.launch], [async][CoroutineScope.async], etc)
24
24
* and every scoping function (like [coroutineScope], [withContext], etc) provides _its own_ scope
@@ -164,8 +164,8 @@ public object GlobalScope : CoroutineScope {
164
164
* }
165
165
* ```
166
166
*
167
-
* Semantics of the scope in this example:
168
-
* 1) `showSomeData` returns as soon as data is loaded and displayed in the UI.
167
+
* The scope in this example has the following semantics:
168
+
* 1) `showSomeData` returns as soon as the data is loaded and displayed in the UI.
169
169
* 2) If `doSomeWork` throws an exception, then the `async` task is cancelled and `showSomeData` rethrows that exception.
170
170
* 3) If the outer scope of `showSomeData` is cancelled, both started `async` and `withContext` blocks are cancelled.
171
171
* 4) If the `async` block fails, `withContext` will be cancelled.
0 commit comments