Skip to content

Instantly share code, notes, and snippets.

@jaozinfs
Created June 7, 2022 19:59
Show Gist options
  • Save jaozinfs/ae0f75647c725255a2648d0c426285d9 to your computer and use it in GitHub Desktop.
Save jaozinfs/ae0f75647c725255a2648d0c426285d9 to your computer and use it in GitHub Desktop.
suspend fun fetchTwoDocs() = coroutineScope {
val deferreds = listOf(
async { fetchDoc(1) },
async { fetchDoc(2) }
)
deferreds.awaitAll()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment