public class AsyncTaskManager
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static AsyncTaskManager |
getInstance()
Returns the singleton instance for
AsyncTaskManager |
<V> java.util.concurrent.Future<?> |
submit(java.util.concurrent.Callable<V> action,
javafx.event.EventHandler<javafx.concurrent.WorkerStateEvent> onSucceeded,
javafx.event.EventHandler<javafx.concurrent.WorkerStateEvent> onFailed)
Submit an action as a
Callable instance to be run asynchronously, as well as callback to handle success and failure of the main action. |
<V> java.util.concurrent.Future<?> |
submit(javafx.concurrent.Task<V> task)
Submit a
Task on the AsyncTaskManager thread pool |
public static AsyncTaskManager getInstance()
AsyncTaskManagerAsyncTaskManagerpublic <V> java.util.concurrent.Future<?> submit(javafx.concurrent.Task<V> task)
Task on the AsyncTaskManager thread poolV - the parameter type for the tasktask - the Task instance to executepublic <V> java.util.concurrent.Future<?> submit(java.util.concurrent.Callable<V> action,
javafx.event.EventHandler<javafx.concurrent.WorkerStateEvent> onSucceeded,
javafx.event.EventHandler<javafx.concurrent.WorkerStateEvent> onFailed)
Callable instance to be run asynchronously, as well as callback to handle success and failure of the main action.V - the parameter type for the taskaction - an action as a Callable instance to be run asynchronouslyonSucceeded - a callback to handle successonFailed - a callback to handle failureCopyright © 2018 Frederic Thevenet. All rights reserved.