Class UiAsyncTasks.SupplierConfigurer<T>

java.lang.Object
io.jmix.flowui.asynctask.UiAsyncTasks.AbstractAsyncTaskConfigurer
io.jmix.flowui.asynctask.UiAsyncTasks.SupplierConfigurer<T>
Type Parameters:
T - the result type of the asynchronous task
Enclosing class:
UiAsyncTasks

public class UiAsyncTasks.SupplierConfigurer<T> extends UiAsyncTasks.AbstractAsyncTaskConfigurer
A builder class for configuring and executing asynchronous tasks that return a result.
  • Constructor Details

    • SupplierConfigurer

      public SupplierConfigurer(Supplier<T> asyncTask)
  • Method Details

    • withResultHandler

      public UiAsyncTasks.SupplierConfigurer<T> withResultHandler(Consumer<? super T> resultHandler)
      Sets a handler that is called when the asynchronous task completes successfully. The handler can safely update Vaadin UI components.
    • withExceptionHandler

      public UiAsyncTasks.SupplierConfigurer<T> withExceptionHandler(Consumer<Throwable> exceptionHandler)
      Sets a handler that is called when the asynchronous task throws an exception. The handler can safely update Vaadin UI components. If not set, then the default exception handler will be used.
    • withTimeout

      public UiAsyncTasks.SupplierConfigurer<T> withTimeout(int timeout, TimeUnit timeoutUnit)
      Sets the timeout for the asynchronous task. If the task is not completed within the specified timeout, a TimeoutException is thrown.
    • supplyAsync

      public CompletableFuture<Void> supplyAsync()
      Configures and returns a CompletableFuture that asynchronously executes the task.