From 2d48ecdc62a27a269469e43191f5e3dd169ed76f Mon Sep 17 00:00:00 2001 From: stephen-hero <78870893+stephen-hero@users.noreply.github.com> Date: Mon, 11 Dec 2023 17:56:45 +0200 Subject: [PATCH] Update task.md language checked --- Coroutines/Outer scope/task.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Coroutines/Outer scope/task.md b/Coroutines/Outer scope/task.md index 39a27b2..0bf9b1a 100644 --- a/Coroutines/Outer scope/task.md +++ b/Coroutines/Outer scope/task.md @@ -1,7 +1,7 @@ -When you start new coroutines inside the given scope, it's much easier to ensure that all of them run with the same -context. It is also much easier to replace the context if needed. +When you start new coroutines within a given scope, it becomes much easier to ensure that all of them run within the same +context. It also simplifies the process of replacing the context if needed. -Now it's time to learn how using the dispatcher from the outer scope works. The new scope created by +Now, it's time to learn how utilizing the dispatcher from the outer scope works. The new scope created by either the `coroutineScope` or by the coroutine builders always inherits the context from the outer scope. In this case, the outer scope is the scope the `suspend loadContributorsConcurrent()` function was called from: @@ -12,8 +12,8 @@ launch(Dispatchers.Default) { // outer scope } ``` -All of the nested coroutines are automatically started with the inherited context. The dispatcher is a part of this -context. That's why all of the coroutines started by `async` are started with the context of the default dispatcher: +All nested coroutines are automatically started with the inherited context, of which the dispatcher is a part. +That's why all of the coroutines instigated by `async` are started within the context of the default dispatcher: ```kotlin suspend fun loadContributorsConcurrent( @@ -28,14 +28,14 @@ suspend fun loadContributorsConcurrent( } ``` -With structured concurrency, you can specify the major context elements (like dispatcher) once, when creating the -top-level coroutine. All the nested coroutines then inherit the context and modify it only if needed. +With structured concurrency, you can specify major context elements (such as the dispatcher) once, when creating the +top-level coroutine. All nested coroutines then inherit this context and only modify it as needed.