Package org.eclipse.lsp4j.jsonrpc
Class CompletableFutures
- java.lang.Object
-
- org.eclipse.lsp4j.jsonrpc.CompletableFutures
-
public final class CompletableFutures extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CompletableFutures.FutureCancelChecker
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <R> java.util.concurrent.CompletableFuture<R>
computeAsync(java.util.concurrent.Executor executor, java.util.function.Function<CancelChecker,R> code)
A utility method to create aCompletableFuture
with cancellation support.static <R> java.util.concurrent.CompletableFuture<R>
computeAsync(java.util.function.Function<CancelChecker,R> code)
A utility method to create aCompletableFuture
with cancellation support.
-
-
-
Method Detail
-
computeAsync
public static <R> java.util.concurrent.CompletableFuture<R> computeAsync(java.util.function.Function<CancelChecker,R> code)
A utility method to create aCompletableFuture
with cancellation support.- Parameters:
code
- a function that accepts aCancelChecker
and returns the to be computed value- Returns:
- a future
-
computeAsync
public static <R> java.util.concurrent.CompletableFuture<R> computeAsync(java.util.concurrent.Executor executor, java.util.function.Function<CancelChecker,R> code)
A utility method to create aCompletableFuture
with cancellation support.- Parameters:
code
- a function that accepts aCancelChecker
and returns the to be computed value- Returns:
- a future
-
-