Class AntlrTaskManager

java.lang.Object
org.pgcodekeeper.core.parsers.antlr.base.AntlrTaskManager

public final class AntlrTaskManager extends Object
Manages execution and completion of asynchronous ANTLR parsing tasks. Uses a fixed thread pool for parallel parsing operations.
  • 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

      public static <T> Future<T> submit(Callable<T> task)
      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 task
      task - the parsing task to execute
      finalizer - consumer to process the result when complete
    • finish

      public static void finish(Queue<AntlrTask<?>> antlrTasks) throws InterruptedException, IOException
      Processes all tasks in the queue until completion or failure.
      Parameters:
      antlrTasks - queue of tasks to process
      Throws:
      InterruptedException - if task processing was interrupted
      IOException - if an I/O error occurred during parsing