Since ktor client needs to be closed, is it possib...
# ktor
b
Since ktor client needs to be closed, is it possible to somehow attach it to the CoroutineScope so that it would close when the scope cancels/completes?
s
Yes, there is
embeddedServer
Which I am using but I am a bit confused about graceful shutting down. https://kotlinlang.slack.com/archives/C0A974TJ9/p1654196853611749
b
Note that I'm asking specifically about the client, not the server. i.e. HttpClient
s
Whoops, sorry misread.
Have you used such a pattern elsewhere? Where you couple the lifecycle of a
Closeable
to a
CoroutineScope
? I have thought about it but never actually done it.
b
I have not, unfortunatelly.