Package io.micronaut.context.python
@Configuration
@Requires(property="micronaut.python.enabled",
notEquals="false")
@NullMarked
package io.micronaut.context.python
Core APIs for Python integration.
-
ClassDescriptionConfiguration options for the GraalPy context.Customizes every GraalPy context builder created by Micronaut.Factory bean that creates and initializes the GraalPy context.Converts a polyglot value to a generated Java wrapper type.A Python value evaluated and cached independently in each pooled GraalPy context.A generated pooled Python stub that can resolve its Python value for a specific context.Configuration for Python asyncio integration.Runtime helpers for Python coroutine bridge methods.Completes futures with Java exceptions from Python exception data.Runs
asyncio.run_in_executor(None, ...)callbacks on Micronaut's blocking executor.CompletableFuture variant that can propagate Java cancellation to a Python task.The subscription handed to a Java subscriber of a Python async iterator, and the facade the Python driver signals through.Subscribes to a publisher one item at a time on behalf of a Python async iterator.Coercion of Java values into a Python context: standard types, generated wrappers, pooled values and the members they expose, including the adaptation of async Java members for Python callers.Adapter invoked from Python async member facades.Configuration for Micronaut Python integration.Executes a callback with exclusive access to a Python-owned polyglot context.Runtime coordination point for generated Python bridge classes.An instance allocated byPythonContextRuntime.allocateInstance(PythonContextRuntime.PythonClassReference, Object...), with the arguments its__init__receives fromPythonContextRuntime.initializeInstance(AllocatedInstance).Pre-split Python class identity used by generated bridge code.Conversion of Python values to Java: none checks, scalars, collections, optionals, enums and the generated wrapper types.Event-loop operations required to drive Micronaut-managed Python asyncio tasks.Provides the active Python event loop for the current execution.Support for the Java classes generated for Python exceptions that extend a Java exception class.The functional interfaces the Python compiler found in the Java types the Python sources reference: the host access converts a Python callable to each of them by the arity of the callable, so that a Java method overloaded on functional interfaces, or on a functional interface andIterable, is called with a plain lambda (seePythonCallables).A functional interface, named rather than referenced: an interface of a compile-time only dependency is absent at run time, and the host access skips an entry it cannot load instead of failing with the Python context.Members of Java objects that GraalPy host interop does not expose: the public methods a public class inherits from a non-public superclass.Conversion of Python return values that are HTTP responses or reactive publishers.The default methods of the Java interfaces a Python class implements, made available to Python code.A default method (with its overloads) installed on a Python class;PythonInterfaceDefaults.DefaultMethod.invoke(Value, Value)is what the installed Python method calls.Interop helpers for Python code that calls Java APIs.Invocation of Python methods and descriptors from generated Java bridges.The runtime side of a Python class that extends a Java class.The construction of the Java instance of a Python object, see.invalid reference
#constructing(Value)Configuration for the PythonPool.The per-context Python instances of one pooled bean that has constructor arguments.The runtime entry points of a pooled bean that owns its per-context values.Serves thePythonPoolStatisticssnapshot at/pythonpoolwhen the management module is on the classpath.A snapshot of the Python context pool.Publisher adapters of the Python bridge that keep the reactive context of the subscriber.The reactive context a subscriber (or the caller of an eager coroutine) hands to a Python coroutine: the Reactor context of the subscription (a reactive transaction status lives there) and the propagated context it carries.Records the application context that is starting, so generated Python code that runs before the@ContextGraalPy context bean is initialized can create that bean on demand.Strategy interface that defines a host target type mapping for GraalVM HostAccess.Generated Java wrapper for a Python object that can expose its underlying polyglot value.Build-time generated JavaBean accessor aliases for Python wrappers.Private host reference exposed throughValueCoercible.HOST_OBJECT_MEMBER.The Java base class members of a generated class that extends a Java class.Recovers the generatedValueCoerciblewrapper behind a polyglot value or proxy object, and matches Python arguments against Java parameter types for the runtime proxies.