https://kotlinlang.org logo
#ktor
Title
# ktor
d

Dias

12/19/2018, 10:38 AM
Not really a ktor specific question, but it's in ktor context. We ported our service to ktor from servlet based framework, but we didn't touch any business code which contains blocking calls to db and other http services, do we just need to wrap those calls into
withContext
suspending calls to leverage coroutines better?
👌 2
💯 2
🙏 1
m

mp

12/19/2018, 2:10 PM
yep,
withContext(IO) { /* blocking code */ }
should do the trick