Francis Reynders
03/07/2023, 4:08 PMsimon.vergauwen
03/07/2023, 4:14 PMHttpClient
are you using? Typically you need to call some finalisers after you're done working with them. I often use ResourceScope
for this.
You can still combine it with Either
as well. Here I am doing so for a Postgres
driver. https://github.com/nomisRev/ktor-k8s-zero-downtime/blob/33739b6cb4db1661aa3c8f7b72[…]994/src/commonMain/kotlin/com/fortysevendegrees/env/postgres.kt
Here I consume the code combining either
with resourceScope
.
https://github.com/nomisRev/ktor-k8s-zero-downtime/blob/33739b6cb4db1661aa3c8f7b7293de5c80246994/src/commonMain/kotlin/com/fortysevendegrees/main.kt#L22Francis Reynders
03/07/2023, 4:23 PMResourceScope
and SuspendApp
in mind as well, I thought to apply that later but I may need to already think about how to structure that in a dependent way. Your examples look very nice, will try to base it on that.simon.vergauwen
03/07/2023, 4:25 PM