Package org.prebid.mobile.tasksmanager
Class TasksManager
java.lang.Object
org.prebid.mobile.tasksmanager.TasksManager
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidUtility method to cancel an ongoing background thread taskvoidUtility method to cancel an ongoing main thread taskvoidThis API can be used to execute code block on the background thread.voidexecuteOnMainThread(Runnable task) This API can be used to execute code block on the main thread.static TasksManagerFactory method to obtain the Singleton instance of the TasksManager
-
Field Details
-
mainThreadExecutor
-
backgroundThreadExecutor
-
-
Method Details
-
getInstance
Factory method to obtain the Singleton instance of the TasksManager -
executeOnMainThread
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
Utility method to cancel an ongoing main thread task- Parameters:
task- takes in task to be cancelled
-
executeOnBackgroundThread
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
Utility method to cancel an ongoing background thread task- Parameters:
task- takes in task to be cancelled
-