public final class FxAsync extends Object
Basically a glorified replacement of Platform.runLater(Runnable) that offers task-style methods and allows
for computational calls.
| Modifier and Type | Method and Description |
|---|---|
static <T,U> CompletionStage<U> |
computeOnFxThread(T element,
Function<T,U> compute)
Asynchronously executes a computing operation on the JavaFX thread.
|
static <T> CompletionStage<T> |
doOnFxThread(T element,
Consumer<T> action)
Asynchronously executes a consuming operation on the JavaFX thread.
|
public static <T> CompletionStage<T> doOnFxThread(T element, Consumer<T> action)
T - The type of the element consumedelement - The element to consumeaction - How to consume itCompletionStage to have monitoring over the state of the asynchronous operation.public static <T,U> CompletionStage<U> computeOnFxThread(T element, Function<T,U> compute)
T - The type of the (aggregated if necessary) inputsU - The output typeelement - The element(s) required for the computation (use Tuple2 for pair-based for example)compute - The computation to performCompletionStage to have monitoring over the state of the asynchronous computation.Copyright © 2018. All rights reserved.