Class UiAsyncTasks.RunnableConfigurer

java.lang.Object
io.jmix.flowui.asynctask.UiAsyncTasks.AbstractAsyncTaskConfigurer
io.jmix.flowui.asynctask.UiAsyncTasks.RunnableConfigurer
Enclosing class:
UiAsyncTasks

public class UiAsyncTasks.RunnableConfigurer extends UiAsyncTasks.AbstractAsyncTaskConfigurer
A builder class for configuring and executing asynchronous tasks that do not return a result.
  • Constructor Details

    • RunnableConfigurer

      public RunnableConfigurer(Runnable asyncTask)
  • Method Details

    • withResultHandler

      public UiAsyncTasks.RunnableConfigurer withResultHandler(Runnable resultHandler)
      Sets a handler that is called when the asynchronous task completes successfully. The handler can safely update Vaadin UI components.
    • withExceptionHandler

      public UiAsyncTasks.RunnableConfigurer 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.RunnableConfigurer 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.
    • runAsync

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