https://kotlinlang.org logo
#ktor
Title
# ktor
p

PHondogo

09/14/2022, 11:00 AM
Hello! How can i make HttpClient's coroutine scope not cancelling on call fails?
t

Trevor Stone

09/14/2022, 1:26 PM
not sure what you're trying to do here, but if you need a block that doesn't cannot be canceled you can do
Copy code
withContext(NonCancellable) { 
   //Even if parent is canceled this block won't be
}
This should usually be used sparingly though since it breaks some of the benefits of structured concurrency
6 Views