Open
Description
Hello 😃
In part of tutorial "Canceling the loading of contributors" on step 3 it is suggested to add 3-second delay.
And the actual code sample stands like that:
suspend fun loadContributorsConcurrent(
service: GitHubService,
req: RequestData
): List<User> = coroutineScope {
// ...
GlobalScope.async {
log("starting loading for ${repo.name}")
delay(3000)
// load repo contributors
}
// ...
}
I guess, it shouldn't be GlobalScope.async {}
in this case. Therefore, if we will add GlobalScope
, then loading won't be canceled.
Metadata
Metadata
Assignees
Labels
No labels