code: public static <T, U> CompletionStage<U> computeOnFxThread(final T element, final Function<T, U> compute) {
          return CompletableFuture.supplyAsync(() -> compute.apply(element), Platform::runLater);
      }
docs: Asynchronously executes a computing operation on the JavaFX thread.
  
  @param element The element(s) required for the computation (use {@link Tuple2} for pair-based for example)
  @param compute The computation to perform
  @param <T>     The type of the (aggregated if necessary) inputs
  @param <U>     The output type
  
  @return A {@link CompletionStage} to have monitoring over the state of the asynchronous computation.
  <p>
  Please make sure to read this class' documentation regarding threading and these methods.