From c590777f6ee7dfb4b66e1f78f8e87e097fbeaa63 Mon Sep 17 00:00:00 2001 From: stephen-hero <78870893+stephen-hero@users.noreply.github.com> Date: Tue, 12 Dec 2023 14:46:12 +0200 Subject: [PATCH] Update task.md language checked --- Coroutines/Suspending functions/task.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Coroutines/Suspending functions/task.md b/Coroutines/Suspending functions/task.md index a4edeab..aa2980d 100644 --- a/Coroutines/Suspending functions/task.md +++ b/Coroutines/Suspending functions/task.md @@ -18,12 +18,12 @@ interface GitHubService { Alternatively, Retrofit allows returning the result wrapped in `Response`. In this case, the result body is provided, and it is possible to check for errors manually. This tutorial uses the versions that return `Response`. -See the new declarations `getOrgRepos` and `getRepoContributors` in [src/contributors/GitHubService.kt](course://Coroutines/Suspending functions/src/contributors/GitHubService.kt) +See the new declarations for `getOrgRepos` and `getRepoContributors` in [src/contributors/GitHubService.kt](course://Coroutines/Suspending functions/src/contributors/GitHubService.kt) ## Task -Your task is to change the code of the function that loads contributors to make use of two new suspending functions, -`getOrgRepos()` and `getRepoContributors()`. The new `loadContributorsSuspend()` function is marked as `suspend` to use the +Your task is to change the function code that loads contributors to make use of two new suspending functions, +`getOrgRepos()` and `getRepoContributors()`. The new `loadContributorsSuspend()` function is marked as `suspend` in order to use the new API. > Suspending functions can't be called everywhere. Calling a suspending function from `loadContributorsBlocking()` will @@ -31,10 +31,9 @@ new API. > suspend function". -1. Copy the implementation of `loadContributorsBlocking()` that is defined in [src/tasks/Request1Blocking.kt](course://Coroutines/Suspending functions/src/tasks/Request1Blocking.kt) - into the `loadContributorsSuspend()` that is defined in [src/tasks/Request4Suspend.kt](course://Coroutines/Suspending functions/src/tasks/Request4Suspend.kt). -2. Modify the code so that the new suspending functions are used instead of the ones that return `Call`s. -3. Run the program by choosing the _SUSPEND_ option and ensure that the UI is still responsive while the GitHub requests - are performed. +1. Copy the implementation of `loadContributorsBlocking()` defined in [src/tasks/Request1Blocking.kt](course://Coroutines/Suspending functions/src/tasks/Request1Blocking.kt) + into `loadContributorsSuspend()` defined in [src/tasks/Request4Suspend.kt](course://Coroutines/Suspending functions/src/tasks/Request4Suspend.kt). +2. Modify the code so that the new suspending functions replace the ones that return `Call`s. +3. Run the program by choosing the _SUSPEND_ option and ensure that the UI remains responsive during the execution of GitHub requests. -For a more detailed description, you can look at [this article](https://kotlinlang.org/docs/coroutines-and-channels.html#suspending-functions) \ No newline at end of file +For a more detailed description, you can refer to [this article](https://kotlinlang.org/docs/coroutines-and-channels.html#suspending-functions).