Package io.jmix.flowui.asynctask
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
A builder class for configuring and executing asynchronous tasks that 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 TypeMethodDescriptionConfigures 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
(Consumer<? super T> 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
-
SupplierConfigurer
-
-
Method Details
-
withResultHandler
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
Sets the timeout for the asynchronous task. If the task is not completed within the specified timeout, aTimeoutException
is thrown. -
supplyAsync
Configures and returns aCompletableFuture
that asynchronously executes the task.
-