Package jadx.api.utils.tasks
Interface ITaskExecutor
- All Known Implementing Classes:
TaskExecutor
public interface ITaskExecutor
Schedule and execute tasks combined into stages
with parallel or sequential execution (similar to the fork-join pattern).
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddParallelTasks(List<? extends Runnable> parallelTasks) Add parallel stage with provided tasksvoidaddSequentialTask(Runnable task) Add sequential stage with a single taskvoidaddSequentialTasks(List<? extends Runnable> seqTasks) Add sequential stage with provided tasksvoidBlock until execution is finishedvoidexecute()Start tasks execution.@Nullable ExecutorServiceReturn internal executor service.intintScheduled tasks countintbooleanbooleanvoidsetThreadsCount(int threadsCount) Set threads count for parallel stage.voidNot started tasks will be not executed after this method invocation.
-
Method Details
-
addParallelTasks
Add parallel stage with provided tasks -
addSequentialTasks
Add sequential stage with provided tasks -
addSequentialTask
Add sequential stage with a single task -
getTasksCount
int getTasksCount()Scheduled tasks count -
setThreadsCount
void setThreadsCount(int threadsCount) Set threads count for parallel stage. Can be changed during execution. Defaults to half of processors count. -
getThreadsCount
int getThreadsCount() -
execute
void execute()Start tasks execution. -
getProgress
int getProgress() -
terminate
void terminate()Not started tasks will be not executed after this method invocation. -
isTerminating
boolean isTerminating() -
isRunning
boolean isRunning() -
awaitTermination
void awaitTermination()Block until execution is finished -
getInternalExecutor
Return internal executor service.
-