@@ -118,7 +118,7 @@ This API is used by the `loadContributorsBlocking()` function to fetch the list
118118 * When you get the response, the result is logged by calling the specific `logRepos()` and `logUsers()` functions (`#3 `).
119119 If the HTTP response contains an error, this error will be logged here.
120120 * Finally , get the response' s body, which contains the data you need. For this tutorial, you' ll use an empty list as a
121- result in case there is an error, and you’ ll log the corresponding error (`#4 `).
121+ result in case there is an error, and you' ll log the corresponding error (`#4`).
122122
1231232. To avoid repeating `.body() ?: emptyList()`, an extension function `bodyList()` is declared:
124124
@@ -281,7 +281,7 @@ Make sure to call the logic passed in the callback explicitly. Otherwise, nothin
281281
282282### Use the Retrofit callback API
283283
284- In the previous solution, the whole loading logic is moved to the background thread, but that still isn’ t the best use of
284+ In the previous solution, the whole loading logic is moved to the background thread, but that still isn' t the best use of
285285resources. All of the loading requests go sequentially and the thread is blocked while waiting for the loading result,
286286while it could have been occupied by other tasks. Specifically, the thread could start loading another request to
287287receive the entire result earlier.
@@ -367,7 +367,7 @@ However, this code also fails to achieve our objective. Try to find the answer y
367367
368368#### The second attempted solution for task 3 {initial- collapse- state= " collapsed" }
369369
370- Since the loading requests are started concurrently, there’ s no guarantee that the result for the last one comes last. The
370+ Since the loading requests are started concurrently, there' s no guarantee that the result for the last one comes last. The
371371results can come in any order.
372372
373373Thus, if you compare the current index with the `lastIndex` as a condition for completion, you risk losing the results for
@@ -583,7 +583,7 @@ despite all the requests taking place on the main UI thread:
583583 modify the template for running all of the Kotlin files and enable this option by default.
584584
585585Now all of the code runs on one coroutine, the "load contributors" coroutine mentioned above, denoted as `@coroutine#1`.
586- While waiting for the result, you shouldn’ t reuse the thread for sending other requests because the code is
586+ While waiting for the result, you shouldn' t reuse the thread for sending other requests because the code is
587587written sequentially. The new request is sent only when the previous result is received.
588588
589589Suspending functions treat the thread fairly and don' t block it for "waiting". However, this doesn' t yet bring any concurrency
@@ -725,7 +725,7 @@ create as many as you need.
725725 ```
726726
7277272. Run the code and check the log. All of the coroutines still run on the main UI thread because
728- multithreading hasn’ t been employed yet, but you can already see the benefits of running coroutines concurrently.
728+ multithreading hasn' t been employed yet, but you can already see the benefits of running coroutines concurrently.
7297293 . To change this code to run " contributors" coroutines on different threads from the common thread pool,
730730 specify `Dispatchers .Default ` as the context argument for the `async` function:
731731
@@ -1347,7 +1347,7 @@ they make life easier when you need to understand what's going on.
13471347
13481348## Testing coroutines
13491349
1350- Let’ s now test all solutions to check that the solution with concurrent coroutines is faster than the solution with
1350+ Let ' s now test all solutions to check that the solution with concurrent coroutines is faster than the solution with
13511351the `suspend` functions, and check that the solution with channels is faster than the simple "progress" one.
13521352
13531353In the following task, you' ll compare the total running time of the solutions. You ' ll mock a GitHub service and make
0 commit comments