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?
l
lukaswelte
10/05/2018, 9:36 AM
What do you mean by GET is done?
For ktor you don’t even need an extra scope since a ktor routing already provides a scope to execute the coroutines in
lukaswelte
10/05/2018, 9:38 AM
Are you asking how to start a long running process which is not bound to the request (when request finishes it still runs)?
a
Albert
10/05/2018, 9:43 AM
@lukaswelte Yeah that is what I am asking. I know ktor doesn't have that. Probably wrong example. I know I could use
GobalScope.async
for this. But in my example I wanted to start multiple `async`/`launch` without have to use
GlobalScope.
prefix all the time.
l
lukaswelte
10/05/2018, 9:46 AM
You could use
with(GlobalScope) {}
I’m not sure there is a coroutine specific answer to launching multiple things on the global scope