Since Ktor is asynchronous, should I still use cor...
# ktor
a
Since Ktor is asynchronous, should I still use coroutines to make my database access async? Currently, I'm doing it so, because that's what I saw in KotlinConf app: https://github.com/JetBrains/kotlinconf-app/blob/master/backend/src/org/jetbrains/kotlinconf/backend/database.kt
m
Depends on how you’re connecting to the db.
a
I'm pretty much doing it the same way it is done in the KotlinConf, I linked it above.
m
If you’re using blocking i/o, use
withContext(<http://Dispatchers.IO|Dispatchers.IO>) { ... }
. That’s really what it boils down to