You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
http4k does not use coroutines. so i put all queries in runBlocking { ... }. it works lovely, but if i can do without the dependency that would be more awesomer.
I can't get rid of coroutines. I rely on a custom coroutine context in order to do transactions (i.e. the session a.k.a. java.sql.Connection object is stored inside one). The alternative is to either use thread locals or monads. The former is very difficult to get right in KMP, the latter has a long and storied history that ultimately ends anticlimactically.
Your approach with runBlocking is the best thing that I can think of. Going to close the issue for now.
Activity
cies commentedon Jun 15, 2025
I've added these to my project:
Now my application code is not longer littered with
runBlocking { ... }calls.deusaquilus commentedon Jun 20, 2025
I can't get rid of coroutines. I rely on a custom coroutine context in order to do transactions (i.e. the session a.k.a.
java.sql.Connectionobject is stored inside one). The alternative is to either use thread locals or monads. The former is very difficult to get right in KMP, the latter has a long and storied history that ultimately ends anticlimactically.Your approach with
runBlockingis the best thing that I can think of. Going to close the issue for now.cies commentedon Jun 23, 2025
Lol.
Thankfully I can live with the 1.5MB dependency of kotlin-coroutines. Just wanted to make sure it is unavoidable'ish. Thanks for answering.