|
|
|
|
|
by jayd16
1373 days ago
|
|
I'm aware of the JEP. I said "as seen in this very release" after all. I don't see the advantage to this over async/await style programming. I think you'll see very similar error cases with unobserved exceptions and such. The advantage is that the method signature is indistinguishable from a blocking method. The subtle difference is that scopes close within a method where as async tasks can continue. I suppose you could see an even worse coloring where scopes and futures are used in half the methods instead of async. I'm trying to wrap my head around how this would play out if you were attempting to write a GUI or something where the pattern is a single main thread. I suppose it would work just fine and look very similar to async style programming but with a lot more code one tab to the right. |
|
Harmonious with the platform (jvm) which is based on threads, better stack-traces, accurate profiling info and simpler programming model (without adding async/await/suspend keyword everywhere) etc are some of the advantages.