Coroutines vs Promises: differences, benefits of o...
# android
u
Coroutines vs Promises: differences, benefits of one over the other, etc? I haven't touched Kotlin much yet, so I'm curious of there are some more experienced voices who could weigh in... 1 reply ninjasudo: #coroutines In short, coroutines are like light weight threads. You can launch 100000 coroutines at once and don't get out of memory error. How you will use it depends on framework you chose. So, promises, rx, forkjoin, all can be wrapped by coroutines. Also, Kotlin has first class syntax for coroutines. You can write sequential nonblocking code as it was synchronous code, without nesting tons of callbacks. https://kotlinlang.org/docs/reference/coroutines.html#experimental-status-of-coroutines https://github.com/Kotlin/kotlinx.coroutines/blob/master/coroutines-guide.md