Join Slack
Powered by
Since Ktor is asynchronous, should I still use cor...
# ktor
a
andev
05/30/2019, 10:39 PM
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
mp
05/31/2019, 2:46 PM
Depends on how you’re connecting to the db.
a
andev
05/31/2019, 5:16 PM
I'm pretty much doing it the same way it is done in the KotlinConf, I linked it above.
m
mp
05/31/2019, 7:47 PM
If you’re using blocking i/o, use
withContext(<http://Dispatchers.IO|Dispatchers.IO>) { ... }
. That’s really what it boils down to
3
Views
Open in Slack
Previous
Next