https://kotlinlang.org logo
#coroutines
Title
# coroutines
v

vineethraj49

03/25/2020, 5:49 PM
what's a good way to handle jdbi handles? I'm checking if the following will work, but wanting to check if this is a "solved" problem already
Copy code
suspend fun foo() {
    val context = coroutineContext
    dbi.withHandle { conn ->
        async(context) {
            bizLogic.suspendingFunction()
        }
    }.await()
}
there is this: https://medium.com/@OhadShai/just-a-small-example-of-how-kotlin-coroutines-are-great-c9774fe8434 but I would kind of end up reimplementing withHandle
29 Views