Package org.oscim.utils.async
Class AsyncExecutor
- java.lang.Object
-
- org.oscim.utils.async.AsyncExecutor
-
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
public class AsyncExecutor extends java.lang.Object implements com.badlogic.gdx.utils.DisposableGWT emulation of AsynchExecutor, will call tasks immediately :D
-
-
Constructor Summary
Constructors Constructor Description AsyncExecutor(int maxConcurrent, org.oscim.utils.async.TaskQueue mainloop)Creates a new AsynchExecutor that allows maxConcurrentRunnableinstances to run in parallel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Waits for runningAsyncTaskinstances to finish, then destroys any resources like threads.booleanpost(java.lang.Runnable task)Submits aRunnableto be executed asynchronously.
-
-
-
Method Detail
-
post
public boolean post(java.lang.Runnable task)
Submits aRunnableto be executed asynchronously. If maxConcurrent runnables are already running, the runnable will be queued.- Parameters:
task- the task to execute asynchronously
-
dispose
public void dispose()
Waits for runningAsyncTaskinstances to finish, then destroys any resources like threads. Can not be used after this method is called.- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable
-
-