public class LibgdxTaskExecutor extends java.lang.Object implements TaskExecutor
| Constructor and Description |
|---|
LibgdxTaskExecutor(int threads) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose() |
void |
execute(java.lang.Runnable runnable)
Queues a
Runnable instance to be run on a separate thread |
void |
setMaxFrameTasksPerFrame(int max)
Sets the maximum number of
FrameSpreadTask instances to update per frame |
<T> AsyncResult<T> |
submit(java.util.concurrent.Callable<T> callable)
Submits a
Callable instance to be executed on a separate thread |
void |
submit(FrameSpreadTask task)
Submits a
FrameSpreadTask to be completed over several frames |
AsyncFuture |
submit(java.lang.Runnable runnable)
Submits a
Runnable instance to be executed on a separate thread |
void |
update(float delta)
Updates
FrameSpreadTask instances each frame. |
public void update(float delta)
TaskExecutorFrameSpreadTask instances each frame.
Note: This is called by mini2Dx and should not be called manually.update in interface TaskExecutordelta - The game delta timepublic void execute(java.lang.Runnable runnable)
TaskExecutorRunnable instance to be run on a separate threadexecute in interface TaskExecutorrunnable - The task to run on a separate threadpublic AsyncFuture submit(java.lang.Runnable runnable)
TaskExecutorRunnable instance to be executed on a separate threadsubmit in interface TaskExecutorrunnable - The task to run on a separate threadAsyncFuture instance that can be checked for task completionpublic <T> AsyncResult<T> submit(java.util.concurrent.Callable<T> callable)
TaskExecutorCallable instance to be executed on a separate threadsubmit in interface TaskExecutorT - The return typecallable - The task to run on a separate threadAsyncResult instance that can be checked for task completionpublic void submit(FrameSpreadTask task)
TaskExecutorFrameSpreadTask to be completed over several framessubmit in interface TaskExecutortask - The FrameSpreadTask to executepublic void setMaxFrameTasksPerFrame(int max)
TaskExecutorFrameSpreadTask instances to update per framesetMaxFrameTasksPerFrame in interface TaskExecutormax - The maximum number greater than 0public void dispose()
dispose in interface org.mini2Dx.gdx.utils.Disposable