javafx.concurrent.Task
s. This
interface provides a way of decoupling task submission from the
mechanics of how each task will be run, including details of thread
use, scheduling, thread pooling, etc.
Modifier and Type | Method and Description |
---|---|
public DelayTaskThrottler | createThrottler(int delay)
Creates a new task throttler, and registers it so that it gets properly shutdown. |
public < type of return value of the task V> Future | execute(BackgroundTask<V>
the task to run task)Runs the given task and returns a Future representing that task. |
public <V> Future | Returns: a ScheduledFuture representing pending completion of the task and whoseget() method will return
null upon completionthe task to execute task, long the time from now to delay execution delay, TimeUnit the time unit of the delay parameter unit)Submits a one-shot task that becomes enabled after the given delay. |
public void |
createThrottler | back to summary |
---|---|
public DelayTaskThrottler createThrottler(int delay) Creates a new task throttler, and registers it so that it gets properly shutdown. |
execute | back to summary |
---|---|
public <V> Future Runs the given task and returns a Future representing that task.
|
schedule | back to summary |
---|---|
public <V> Future Submits a one-shot task that becomes enabled after the given delay.
|
shutdown | back to summary |
---|---|
public void shutdown() Shutdown the task executor. May happen in the background or may be finished when this method returns. |