Interface Executor

All Superinterfaces:
FunctionPointer
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface @Generated("org.javagi.JavaGI") public interface Executor extends FunctionPointer

Functional interface declaration of the Executor callback.

See Also:
  • Method Details

    • run

      void run(Value resolve, Value reject)

      A function passed to jscValueNewPromise called during initialization

      It is called like a JavaScript function, so exceptions raised will not be propagated to the context, but handled by the promise causing a rejection. resolve and reject can be reffed for later use to handle async task completion.

      Parameters:
      resolve - JSCValue function to call to resolve the promise
      reject - JSCValue function to call to reject the promise
      Since:
      2.48
    • upcall

      default void upcall(MemorySegment resolve, MemorySegment reject, MemorySegment userData)
      The upcall method is called from native code. The parameters are marshaled and run(Value, Value) is executed.
    • toCallback

      default MemorySegment toCallback(Arena arena)
      Creates a native function pointer to the upcall(MemorySegment, MemorySegment, MemorySegment) method.
      Specified by:
      toCallback in interface FunctionPointer
      Parameters:
      arena - the arena in which the function pointer is allocated
      Returns:
      the native function pointer