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

deviant

03/14/2017, 9:06 AM
what is the main benefit of using coroutines instead?
non-blocking code? 🙂
p

pabl0rg

03/14/2017, 8:30 PM
@deviant RxJava and Reactive Streams also facilitate writing non-blocking code. I was trying to ask what coroutines will do better. I think I understand better now.
d

deviant

03/14/2017, 8:43 PM
rxjava still uses callbacks/futures concept. when you use it synchronously it still blocks the thread. coroutine can suspend the running code context without blocking the thread.
g

groostav

03/14/2017, 10:48 PM
that's not quite accurate, if your using callbacks on a future then you are using it synchronously (in that A happens before B), but it is not blocking.
d

deviant

03/15/2017, 11:05 AM
sure. but who wants callbacks hell when we have coroutines?
2 Views