https://kotlinlang.org logo
e

elizarov

12/20/2016, 10:26 AM
The advantage of this approach it that you can define
suspend operator hasNext()
and
suspend operator next()
. They can do
suspendCoroutine
and wait (non-blocking) until the value is observed, then resume the coroutine. This way you'll be able to use Kotlin's
for
loop with your observables.