Interface AsyncReadyCallback

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 AsyncReadyCallback extends FunctionPointer

Functional interface declaration of the AsyncReadyCallback callback.

See Also:
  • Method Details

    • run

      void run(@Nullable GObject sourceObject, AsyncResult res, @Nullable MemorySegment data)

      Type definition for a function that will be called back when an asynchronous operation within GIO has been completed. GAsyncReadyCallback callbacks from GTask are guaranteed to be invoked in a later iteration of the thread-default main context (see MainContext#pushThreadDefault) where the GTask was created. All other users of GAsyncReadyCallback must likewise call it asynchronously in a later iteration of the main context.

      The asynchronous operation is guaranteed to have held a reference to sourceObject from the time when the *_async() function was called, until after this callback returns.

      Parameters:
      sourceObject - the object the asynchronous operation was started with.
      res - a GAsyncResult.
      data - user data passed to the callback.
    • upcall

      default void upcall(MemorySegment sourceObject, MemorySegment res, MemorySegment data)
      The upcall method is called from native code. The parameters are marshaled and run(GObject, AsyncResult, MemorySegment) 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