Package org.prebid.mobile.tasksmanager
Class TasksManager
- java.lang.Object
-
- org.prebid.mobile.tasksmanager.TasksManager
-
public class TasksManager extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description java.util.concurrent.ExecutorbackgroundThreadExecutorjava.util.concurrent.ExecutormainThreadExecutor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancelTaksOnBackgroundThread(java.lang.Runnable task)Utility method to cancel an ongoing background thread taskvoidcancelTaskOnMainThread(java.lang.Runnable task)Utility method to cancel an ongoing main thread taskvoidexecuteOnBackgroundThread(java.lang.Runnable task)This API can be used to execute code block on the background thread.voidexecuteOnMainThread(java.lang.Runnable task)This API can be used to execute code block on the main thread.static TasksManagergetInstance()Factory method to obtain the Singleton instance of the TasksManager
-
-
-
Method Detail
-
getInstance
public static TasksManager getInstance()
Factory method to obtain the Singleton instance of the TasksManager
-
executeOnMainThread
public void executeOnMainThread(java.lang.Runnable task)
This API can be used to execute code block on the main thread.- Parameters:
task- takes in task (to be executed on main thread) as a runnable
-
cancelTaskOnMainThread
public void cancelTaskOnMainThread(java.lang.Runnable task)
Utility method to cancel an ongoing main thread task- Parameters:
task- takes in task to be cancelled
-
executeOnBackgroundThread
public void executeOnBackgroundThread(java.lang.Runnable task)
This API can be used to execute code block on the background thread.- Parameters:
task- takes in task (to be executed on background thread) as a runnable
-
cancelTaksOnBackgroundThread
public void cancelTaksOnBackgroundThread(java.lang.Runnable task)
Utility method to cancel an ongoing background thread task- Parameters:
task- takes in task to be cancelled
-
-