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 Summary
Modifier and TypeMethodDescriptionvoidrun(@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.default MemorySegmenttoCallback(Arena arena) Creates a native function pointer to theupcall(MemorySegment, MemorySegment, MemorySegment)method.default voidupcall(MemorySegment sourceObject, MemorySegment res, MemorySegment data) Theupcallmethod is called from native code.
-
Method Details
-
run
Type definition for a function that will be called back when an asynchronous operation within GIO has been completed.
GAsyncReadyCallbackcallbacks fromGTaskare guaranteed to be invoked in a later iteration of the thread-default main context (see MainContext#pushThreadDefault) where theGTaskwas created. All other users ofGAsyncReadyCallbackmust likewise call it asynchronously in a later iteration of the main context.The asynchronous operation is guaranteed to have held a reference to
sourceObjectfrom the time when the*_async()function was called, until after this callback returns.- Parameters:
sourceObject- the object the asynchronous operation was started with.res- aGAsyncResult.data- user data passed to the callback.
-
upcall
Theupcallmethod is called from native code. The parameters are marshaled andrun(GObject, AsyncResult, MemorySegment)is executed. -
toCallback
Creates a native function pointer to theupcall(MemorySegment, MemorySegment, MemorySegment)method.- Specified by:
toCallbackin interfaceFunctionPointer- Parameters:
arena- the arena in which the function pointer is allocated- Returns:
- the native function pointer
-