3 ms·
Where is aysnc await?
by ed_blackburn 11y ago
Where is aysnc await?
- the8472 11y agoCompleteableFuture[1] is the closest we got for now in the JDK. [1] https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html https://docs.oracle.com/javase/8/docs/api/java/util/concurre...
- SloopJon 11y agoI just started using CompletableFuture last week. The way each method ties your lambdas together without a bunch of type boilerplate is really nice. I still don't have a great handle on all of its methods, though; e.g., what's the difference between get() and join()?
- kilink 11y agoCompletableFuture implements Future, so the get method is an implementation of Future.get [1]. Anyway, the major difference is that Future.get throws 2 checked exceptions, InterruptedException and ExecutionException, while CompletableFuture.join does not throw any checked exception. Instead, it wraps any exceptions in CompletionException. [1] https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html#get() https://docs.oracle.com/javase/7/docs/api/java/util/concurre...
- pkolaczk 11y agoIn Scala: https://github.com/scala/async https://github.com/scala/async