Class PythonAsyncioRuntime.PythonCompletableFuture

java.lang.Object
java.util.concurrent.CompletableFuture<Object>
io.micronaut.context.python.PythonAsyncioRuntime.PythonCompletableFuture
All Implemented Interfaces:
CompletionStage<Object>, Future<Object>
Enclosing class:
PythonAsyncioRuntime

public static final class PythonAsyncioRuntime.PythonCompletableFuture extends CompletableFuture<Object>
CompletableFuture variant that can propagate Java cancellation to a Python task.
  • Constructor Details

    • PythonCompletableFuture

      public PythonCompletableFuture()
  • Method Details

    • setCancelCallback

      public void setCancelCallback(Runnable cancelCallback)
      Set a callback invoked when this future is cancelled.
      Parameters:
      cancelCallback - The cancellation callback.
    • cancel

      public boolean cancel(boolean mayInterruptIfRunning)
      Specified by:
      cancel in interface Future<Object>
      Overrides:
      cancel in class CompletableFuture<Object>