public class BackgroundTaskWrapper<T,V>
extends java.lang.Object
BackgroundWorker
Constructor and Description |
---|
BackgroundTaskWrapper() |
BackgroundTaskWrapper(BackgroundTask<T,V> task) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel running task if there is any.
|
V |
getResult()
If there is running task, block until its completion and return result.
|
void |
restart()
Cancel running task if there is at the moment.
|
void |
restart(BackgroundTask<T,V> task)
Cancel running task if there is at the moment.
|
public BackgroundTaskWrapper(@Nullable BackgroundTask<T,V> task)
public BackgroundTaskWrapper()
public void restart()
public void restart(BackgroundTask<T,V> task)
task
- task to start, also will be saved for future restarts@Nullable public V getResult()
public void cancel()