Package io.jmix.flowui.asynctask
Class UiAsyncTasks.RunnableConfigurer
java.lang.Object
io.jmix.flowui.asynctask.UiAsyncTasks.AbstractAsyncTaskConfigurer
io.jmix.flowui.asynctask.UiAsyncTasks.RunnableConfigurer
- Enclosing class:
- UiAsyncTasks
A builder class for configuring and executing asynchronous tasks that do not return a result.
-
Field Summary
Fields inherited from class io.jmix.flowui.asynctask.UiAsyncTasks.AbstractAsyncTaskConfigurer
exceptionHandler, timeout, timeoutUnit, ui
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionrunAsync()
Configures and returns aCompletableFuture
that asynchronously executes the task.withExceptionHandler
(Consumer<Throwable> exceptionHandler) Sets a handler that is called when the asynchronous task throws an exception.withResultHandler
(Runnable resultHandler) Sets a handler that is called when the asynchronous task completes successfully.withTimeout
(int timeout, TimeUnit timeoutUnit) Sets the timeout for the asynchronous task.Methods inherited from class io.jmix.flowui.asynctask.UiAsyncTasks.AbstractAsyncTaskConfigurer
configureExceptionHandler, configureTimeout
-
Constructor Details
-
RunnableConfigurer
-
-
Method Details
-
withResultHandler
Sets a handler that is called when the asynchronous task completes successfully. The handler can safely update Vaadin UI components. -
withExceptionHandler
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
Sets the timeout for the asynchronous task. If the task is not completed within the specified timeout, aTimeoutException
is thrown. -
runAsync
Configures and returns aCompletableFuture
that asynchronously executes the task.
-