badoo / Reaktive

Kotlin multi-platform implementation of Reactive Extensions
Apache License 2.0
1.18k stars 58 forks source link

Couroutine interop extension for Single #629

Closed saket closed 3 years ago

saket commented 3 years ago

Will it be possible to add a coroutine interop operator for Single? I see that the official interop library has some extensions for RxJava2: https://github.com/Kotlin/kotlinx.coroutines/tree/master/reactive/kotlinx-coroutines-rx2

In the meantime, I'm using Single#asObservable()#asFlow().collect. It looks ugly and not even sure if it's correct, but it seems to work. I think Single#blockingGet() will also work but I've run into very strange deadlock issues in the past with blockingGet on RxJava so I try to stay away from it.

arkivanov commented 3 years ago

There is coroutines-interop module. Will it work for you? Check out the readme: https://github.com/badoo/Reaktive#coroutines-interop

arkivanov commented 3 years ago

Closing the issue for now. Feel free to reopen if there are any questions.