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

Big Chungus

06/03/2022, 8:46 PM
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

simon.vergauwen

06/06/2022, 1:13 PM
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

Big Chungus

06/06/2022, 1:30 PM
Note that I'm asking specifically about the client, not the server. i.e. HttpClient
s

simon.vergauwen

06/06/2022, 1:46 PM
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

Big Chungus

06/06/2022, 1:47 PM
I have not, unfortunatelly.