Skip to content
RED SAGSkills
hard20 pts · first answer countskotlin-coroutinesstructured-concurrency

One failing request in coroutineScope

api.banner() throws an exception. What happens, and how can the home screen still show the feed when only the banner fails?

suspend fun loadHome() = coroutineScope {
  val banner = async { api.banner() }
  val feed = async { api.feed() }
  Home(banner.await(), feed.await())
}
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions