Janez Štupar
09/11/2018, 2:07 PMrobin
09/11/2018, 2:10 PMsuspendCoroutine
function from the ktor request handler, and resume the coroutine inside that once the observable completes. Something like this (from memory, so might not be completely correct):
val observable: Observable
val observableResult = suspendCoroutine { continuation ->
observable.subscribe { it -> continuation.resume(it) }
}
Janez Štupar
09/11/2018, 2:14 PMrobin
09/11/2018, 2:15 PMsuspendCoroutine
to bridge the two worlds 🙂Janez Štupar
09/11/2018, 3:38 PM