File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
kotlinx-coroutines-core/common/src Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -42,14 +42,14 @@ import kotlin.coroutines.intrinsics.*
4242 * ### Custom usage
4343 *
4444 * `CoroutineScope` should be declared as a property on entities with a well-defined lifecycle that are
45- * responsible for launching children coroutines. The corresponding instance of `CoroutineScope` shall be created
46- * with either `CoroutineScope()` or `MainScope()` functions. The difference between them is only in the
47- * [CoroutineDispatcher]:
45+ * responsible for launching child coroutines. The corresponding instance of `CoroutineScope` shall be created
46+ * with either `CoroutineScope()` or `MainScope()`:
4847 *
49- * * `CoroutineScope()` uses [Dispatchers.Default] for its coroutines.
50- * * `MainScope()` uses [Dispatchers.Main] for its coroutines.
48+ * * `CoroutineScope()` uses the [context][CoroutineContext] provided to it as a parameter for its coroutines
49+ * and adds a [Job] if one is not provided as part of the context.
50+ * * `MainScope()` uses [Dispatchers.Main] for its coroutines and has a [SupervisorJob].
5151 *
52- * **The key part of custom usage of `CustomScope ` is cancelling it at the end of the lifecycle.**
52+ * **The key part of custom usage of `CoroutineScope ` is cancelling it at the end of the lifecycle.**
5353 * The [CoroutineScope.cancel] extension function shall be used when the entity that was launching coroutines
5454 * is no longer needed. It cancels all the coroutines that might still be running on behalf of it.
5555 *
You can’t perform that action at this time.
0 commit comments