Interface BasicFuture<V>
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault void
cancel()
default BasicFuture
<V> Wraps this future in a new future that, upon being interrupted while joining, will cancel this future.static <V> BasicFuture
<V> completedTask
(V value) static void
static <V> V
static <V> BasicFuture
<V> failedTask
(Throwable exception) default <U> BasicFuture
<U> flatMap
(Function<V, BasicFuture<U>> mapper) default <U> BasicFuture
<U> flatMapAsync
(Function<V, BasicFuture<U>> mapper) Unlike when usingflatMap(java.util.function.Function<V, dev.pfaff.altargui.util.BasicFuture<U>>)
,mapper
always executes asynchronously.join()
default <U> BasicFuture
<U> default <U> BasicFuture
<U> Unlike when usingmap(java.util.function.Function<V, U>)
,mapper
always executes asynchronously.static <V> BasicFuture
<V> spawnTaskOn
(Callable<V> callable, Executor executor) default BasicFuture
<Void> thenAccept
(Consumer<V> consumer) default BasicFuture
<Void> thenAcceptAsync
(Consumer<V> consumer) Unlike when usingthenAccept(java.util.function.Consumer<V>)
,consumer
always executes asynchronously.default BasicFuture
<V> uncatch()
Spawns a new virtual thread that joins this future and does not attempt to catch exceptions.static <V> BasicFuture
<V> wrap
(CompletableFuture<V> future) static <V> BasicFuture
<V>
-
Field Details
-
COMPLETED_NULL
-
-
Method Details
-
join
-
cancel
default void cancel() -
cancelOnInterrupt
Wraps this future in a new future that, upon being interrupted while joining, will cancel this future. -
uncatch
Spawns a new virtual thread that joins this future and does not attempt to catch exceptions. If one is thrown, the default uncaught exception handler for the VM will be invoked.- Returns:
- this future.
-
map
-
flatMap
-
thenAccept
-
mapAsync
Unlike when usingmap(java.util.function.Function<V, U>)
,mapper
always executes asynchronously. -
flatMapAsync
Unlike when usingflatMap(java.util.function.Function<V, dev.pfaff.altargui.util.BasicFuture<U>>)
,mapper
always executes asynchronously. -
thenAcceptAsync
Unlike when usingthenAccept(java.util.function.Consumer<V>)
,consumer
always executes asynchronously. -
completedTask
-
failedTask
-
wrap
-
wrap
-
spawnTaskOn
-
executeOn
-
executeOn
-