How do I properly launch a long-running task in Ktor sever without waiting for its completion, i.e.
launch and immediately send the HTTP response back.
In this answer: /a/73930834/12570695
Something like this is suggested:
CoroutineScope(Dispatchers.IO).launch {
// long-running task
}
However, in this answer: /a/75843232
This approach is highly discouraged because it creates an unmanaged coroutine scope.
How to do it properly?