i’m thinking of this: ```GlobalScope.async { Ca...
# coroutines
s
i’m thinking of this:
Copy code
GlobalScope.async {
  CallA() {
  if (it.success) {
   GlobalScope.async { CallB( it.value) }
 else { LogError() }
} }
😱 2
b
Is this an Android app… or?
s
yes
d
Copy code
kotlin
val myScope = CoroutineScope(Dispatchers.Main + SupervisorJob())


// in some func
myScope.launch {
    val result = withContext(Dispatchers.Default) {
        // async computation
        CallA()
    }
    // back on main thread
    CallB(result)
}