Java get method "Expects if necessary to complete this future", i.e. blocks the current thread. We absolutely never want to do this in JavaScript, which has only one "stream".
It would be possible to integrate the methods into the API to synchronously determine which results the completion promises, but it is good that they did not. Having only one then method to get results when they are available makes things much easier, safer and more consistent. There is no use writing your own if-pending-then-this-else-this logic, it only opens up the possibilities for errors. Asynchrony is tough.
Bergi Jul 28 '17 at 16:34 2017-07-28 16:34
source share