|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.badlogic.gdx.utils.async.AsyncExecutor
public class AsyncExecutor
Allows asnynchronous execution of AsyncTask
instances on a separate thread.
Needs to be disposed via a call to dispose()
when no longer used, in which
case the executor waits for running tasks to finish. Scheduled but not yet
running tasks will not be executed.
Constructor Summary | |
---|---|
AsyncExecutor(int maxConcurrent)
Creates a new AsynchExecutor that allows maxConcurrent Runnable instances to run in parallel. |
Method Summary | ||
---|---|---|
void |
dispose()
Waits for running AsyncTask instances to finish,
then destroys any resources like threads. |
|
|
submit(AsyncTask<T> task)
Submits a Runnable to be executed asynchronously. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AsyncExecutor(int maxConcurrent)
Runnable
instances to run in parallel.
maxConcurrent
- Method Detail |
---|
public <T> AsyncResult<T> submit(AsyncTask<T> task)
Runnable
to be executed asynchronously. If
maxConcurrent runnables are already running, the runnable
will be queued.
task
- the task to execute asynchronouslypublic void dispose()
AsyncTask
instances to finish,
then destroys any resources like threads. Can not be used
after this method is called.
dispose
in interface Disposable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |