public abstract class Async<T> extends Object
Constructor and Description |
---|
Async() |
Modifier and Type | Method and Description |
---|---|
abstract T |
await()
Blocks current thread to wait for the result of
this async task.
|
static <T> Async<T> |
start(Callable<T> func)
Starts an async task in a background thread.
|
static Async<Void> |
start(Runnable func)
Starts an async task in a background thread.
|
static <T> Async<T> |
startFX(Callable<T> func)
Runs the task on the JavaFX UI Thread.
|
static Async<Void> |
startFX(Runnable func)
Runs the task on the JavaFX UI Thread.
|
public static <T> Async<T> start(Callable<T> func)
T
- result typefunc
- function to run for resultpublic static Async<Void> start(Runnable func)
func
- function to runpublic static <T> Async<T> startFX(Callable<T> func)
T
- result typefunc
- function to run for resultpublic static Async<Void> startFX(Runnable func)
func
- function to runpublic abstract T await()
Copyright © 2018. All rights reserved.