Class PythonProcessingSession

java.lang.Object
io.micronaut.python.processing.PythonProcessingSession
All Implemented Interfaces:
AutoCloseable

public final class PythonProcessingSession extends Object implements AutoCloseable
Owns the initialized GraalPy processing context across multiple serialized compilations.

A session is not thread safe. Callers must serialize compilations that share it.

Since:
5.2.0
  • Constructor Details

    • PythonProcessingSession

      public PythonProcessingSession()
  • Method Details

    • parser

      @Internal public PythonAstParser parser(ClassLoader classLoader, boolean incremental)
      Obtains the parser for a compilation, initializing GraalPy on first use.
      Parameters:
      classLoader - The annotation processor class loader
      incremental - Whether the compilation is incremental
      Returns:
      The session parser
    • initialized

      public boolean initialized()
      Reports whether GraalPy has been initialized.
      Returns:
      Whether GraalPy has been initialized for this session
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable