Hello all, I am trying to collect your opinions. D...
# javascript
r
Hello all, I am trying to collect your opinions. Do you think there is a sense in using the web workers in Kotlin/JS, with Kotlin coroutines at your disposal?
s
Since coroutines are single-threaded, you do want to use web workers when you need parallel computations.
But I would imagine these cases are rare for typical webapps
g
I didn’t use coroutines in production for js, but I would go with kotlin coroutines instead of webworkers, it is far more suitable and a lot of powerfull 😃
I’m using in jvm and I’m very happy 😃
😃 1
g
Webworkers and coroutines on JS have different use cases and I do not understand how one may compare them You just cannot use raw coroutines to do background tasks, only to communicate with existing asynchronous APIs
But even in case of workers you can use coroutines for communication, I wrote about it in this thread https://kotlinlang.slack.com/archives/C1CFAFJSK/p1552233172285200?thread_ts=1552233172.285200&cid=C1CFAFJSK