<https://kotlinlang.slack.com/archives/C0922A726/p...
# coroutines
though you probably need slightly other link
g
how do I convert/wrap those blocking database/http calls into async calls
there is no real way to convert blocking calls to real non-blocking, no such magic. But you always can wrap blocking call to coroutine that runs this blocking call on a separate thread (and blocks it), but for user of this API it looks as async API and doesn’t block thread where it invoked. Simplest way (with new IO disptatcher)
Copy code
suspend fun someDbCall(sql:String) =    withContext(<http://Dispatchers.IO|Dispatchers.IO>) {
      someBlockingDbCall(sql)
 }