Albert
10/05/2018, 8:14 AMwithContext
?
withContext(GlobalScope.coroutineContext) {
async {
}
launch {
}
}
elizarov
10/05/2018, 8:42 AMcoroutineScope { ... }
Albert
10/05/2018, 9:02 AMrouting {
get("/foo") {
coroutineScope { ... }
}
}
Wouldn't that mean that if GET is done the coroutineScope would be cancelled (of course it depends on how ktor will implement this).
So in this case even after the GET request is done, I don't the coroutine top be cancelled. Or am I understanding coroutineScope wrong?lukaswelte
10/05/2018, 9:36 AMlukaswelte
10/05/2018, 9:38 AMAlbert
10/05/2018, 9:43 AMGobalScope.async
for this. But in my example I wanted to start multiple `async`/`launch` without have to use GlobalScope.
prefix all the time.lukaswelte
10/05/2018, 9:46 AMwith(GlobalScope) {}
I’m not sure there is a coroutine specific answer to launching multiple things on the global scopeAlbert
10/05/2018, 9:47 AM