It uses `Thread.sleep` though, so...
# coroutines
j
It uses
Thread.sleep
though, so...
u
Sure. It is supposed to mock some real work. not a suspended coroutine 🙂
j
But then the use and comparison of coroutines is wasted. It just becomes an abstraction on the ForkJoinPool, Thread, and Future. So the comparison is pointless.
u
As I understand it the comparison is about ease of use, elegance and clarity of code, ...
The author is asking for improvements to the coroutine example.
Copy code
I welcome the reader to try and update the coroutine implementation to accomplish the same behavior (including any other form of cancellation possibility while you are at it).
I am convinced, it can be simplified. But I am also not sure about the relevance of this article.
j
Aside from trying not to choke on the obvious bias, they operate on different levels of abstraction so I'm not sure what value I'm supposed to get out of this.
âž• 2
g
I mean the whole value of coroutines is reduced to that one line paragraph:
[using RX over coroutines provide] A slightly longer implementation and certainly may look scary to those who are not used to so much lambdas.