Interface ViewModelSwingWorkerExecutor
- All Known Implementing Classes:
DefaultViewModelSwingWorkerExecutor
public interface ViewModelSwingWorkerExecutor
-
Method Summary
Modifier and TypeMethodDescriptionstatic ViewModelSwingWorkerExecutor
default <T> BiConsumer<Boolean,
Boolean> execute
(FragileSupplier<T, Exception> onDoInBackground, BiConsumer<T, Exception> onDone) This overloaded variant ofexecute(FragileSupplier, BiConsumer, long)
will not use a timeout.<T> BiConsumer<Boolean,
Boolean> execute
(FragileSupplier<T, Exception> onDoInBackground, BiConsumer<T, Exception> onDone, long timeoutInMillis) Method is used in a swing analogous manor.
-
Method Details
-
execute
<T> BiConsumer<Boolean,Boolean> execute(FragileSupplier<T, Exception> onDoInBackground, BiConsumer<T, Exception> onDone, long timeoutInMillis) Method is used in a swing analogous manor. The backing implementation is aSwingWorker
. You use this method when you need to perform a task that has no progress. In most cases you want to specify a timeout, which is the time for which you will decide that the task is dead, or hung.- Type Parameters:
T
- The expected output fromonDoInBackground
- Parameters:
onDoInBackground
- This will execute on a non-EDT thread. Should return a value to be used byonDone
onDone
- This will execute on the EDT. Will provide the result ofonDoInBackground
, or null if errors have been encountered. The following errors are available:InterruptedException
,ExecutionException
TimeoutException
timeoutInMillis
- To prevent an indefinite wait, supply a timeout. A value equal or less than 0 means that a timeout will not be used.- Returns:
- This
Consumer
allows you to cancel the thread. Corresponds to SwingWorker's cancel() method.
-
execute
default <T> BiConsumer<Boolean,Boolean> execute(FragileSupplier<T, Exception> onDoInBackground, BiConsumer<T, Exception> onDone) This overloaded variant ofexecute(FragileSupplier, BiConsumer, long)
will not use a timeout. -
createDefault
-