Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
fun main(): Unit = runBlocking {
launch {
val tasks = downloadTasks()
private suspend fun downloadTasks() {
// code that makes a network call and returns the list of tasks
return listOf(Task(1), Task(2), Task(3))
private fun printTasks(tasks: List<Task>) {
tasks.forEach { task -> println( }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment