Skip to content

Instantly share code, notes, and snippets.

@GauravChaddha1996
Created January 30, 2021 18:13
Show Gist options
  • Save GauravChaddha1996/ee8711b58bb0ae9484fda6686b6726b0 to your computer and use it in GitHub Desktop.
Save GauravChaddha1996/ee8711b58bb0ae9484fda6686b6726b0 to your computer and use it in GitHub Desktop.
suspend fun t1(): Int {
println("Inside t1() on ${Thread.currentThread().name}")
// Emulate network call
delay(100)
return 1
}
suspend fun t2(param1: Int): String {
println("Inside t2() on ${Thread.currentThread().name}")
// Emulate network call
delay(200)
return "${param1}_".plus("resultT2")
}
suspend fun t3(param2: String): String {
println("Inside t3() on ${Thread.currentThread().name}")
// Emulate network call
delay(200)
return param2.plus("_").plus("resultT3")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment