Class AntlrTaskManager
java.lang.Object
org.pgcodekeeper.core.parsers.antlr.base.AntlrTaskManager
Manages execution and completion of asynchronous ANTLR parsing tasks.
Uses a fixed thread pool for parallel parsing operations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidProcesses all tasks in the queue until completion or failure.static intGets the size of the thread pool used for ANTLR parsing tasks.static <T> Future<T>Submits a parsing task for asynchronous execution.static <T> voidSubmits a parsing task with completion handler.
-
Method Details
-
getPoolSize
public static int getPoolSize()Gets the size of the thread pool used for ANTLR parsing tasks.- Returns:
- number of threads in the pool
-
submit
Submits a parsing task for asynchronous execution.- Type Parameters:
T- type of the parsing result- Parameters:
task- the parsing task to execute- Returns:
- Future representing the pending result
-
submit
public static <T> void submit(Queue<AntlrTask<?>> antlrTasks, Callable<T> task, Consumer<T> finalizer) Submits a parsing task with completion handler.- Type Parameters:
T- type of the parsing result- Parameters:
antlrTasks- queue to store the created tasktask- the parsing task to executefinalizer- consumer to process the result when complete
-
finish
Processes all tasks in the queue until completion or failure.- Parameters:
antlrTasks- queue of tasks to process- Throws:
InterruptedException- if task processing was interruptedIOException- if an I/O error occurred during parsing
-