public class AsyncExecutor extends java.lang.Object implements Disposable
AsyncTaskinstances 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 and Description|
Creates a new AsynchExecutor that allows maxConcurrent
|Modifier and Type||Method and Description|
Waits for running
public AsyncExecutor(int maxConcurrent)
Runnableinstances to run in parallel.
public <T> AsyncResult<T> submit(AsyncTask<T> task)
Runnableto be executed asynchronously. If maxConcurrent runnables are already running, the runnable will be queued.
task- the task to execute asynchronously