I am reading documentation on coroutines and trying to understand the concept. Also I have some experience using Java 8
CompletableFuture class and its infrastructure. My question is the following: what is the principal advantage of coroutines in comparison with
CompletableFuture? I am asking not to prove something, but to understand this new feature better.
So far I can see two important things in coroutines which are not present in
Automatic cancellation of children jobs. It is definitely a very good thing, but it could be emulated by rather simple extension over
- Direct control over context. For now I am not sure, how it could be used on practice.
Is there something else I am missing?