Hello everybody, I would want to know if someone k...
# ktor
l
Hello everybody, I would want to know if someone knows what happens with the resources that a client it’s using in a http call if the coroutine is cancelled by any of the previous coroutines . I saw there’s a method in the response class:
Copy code
public fun CoroutineScope.cancel(message: String, cause: Throwable? = null): Unit = cancel(CancellationException(message, cause))
But it just cancel de coroutine and i don’t know what happens with the connection, buffers, etc. Thanks!
a
You can wrap it with a
try/finally
or use invokeOnCompletion method to free resources.
🙌 1
l
thanks!