Class PythonAsyncioRuntime.ExecutorAdapter

java.lang.Object
io.micronaut.context.python.PythonAsyncioRuntime.ExecutorAdapter
Enclosing class:
PythonAsyncioRuntime

public static final class PythonAsyncioRuntime.ExecutorAdapter extends Object
Runs asyncio.run_in_executor(None, ...) callbacks on Micronaut's blocking executor.
  • Method Details

    • run

      public void run(org.graalvm.polyglot.Value future, org.graalvm.polyglot.Value callback, @Nullable PythonEventLoop eventLoop)
      Run a Python callback on the configured blocking executor and complete a loop future on the event loop.
      Parameters:
      future - The Python asyncio future.
      callback - The Python callback.
      eventLoop - The current event loop, or null for a Python loop running on another thread, which the completion of the future hands the result to.
    • isAvailable

      public boolean isAvailable()
      Whether a Micronaut blocking executor is available to run(Value, Value, PythonEventLoop).
      Returns:
      true when run_in_executor(None, ...) can use the blocking executor