3 ms·
Could you say more about your experience of Kotlin's coroutines vs async / await? I'd love to learn more about that! :)
by loic-sharma 6y ago
Could you say more about your experience of Kotlin's coroutines vs async / await? I'd love to learn more about that! :)
- jitl 6y agoKotlin’s coroutines are mind-bending to me. They multiply all the spooky fears about threading correctly times a second order of semi-deterministic scheduling logic. The API surface around coroutines is also very complex. Javascript provides one simple API for creating a promise object, and a simple model for how async functions interact. On the other hand, Kotlin suspend funcs need to be “launched” or “run” on a coroutine context which may or may not actually allow async behavior, be backed by a thread pool, and transition between schedulers (?). Kotlin coroutines are very flexible but with that power comes a lot of confusing complexity.