Interface IoUringBackend.ExtendedCompletionHandler
- All Superinterfaces:
CompletionHandler
- Enclosing class:
IoUringBackend
Extended completion handler that receives CQE flags.
Use this interface when working with:
- Zero-copy send (SEND_ZC) - check for IORING_CQE_F_NOTIF
- Multi-shot receive - check for IORING_CQE_F_MORE
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonComplete(long token, int result) Called when an asynchronous I/O operation completes.voidonComplete(long token, int result, int flags) Called when an operation completes with flags.
-
Method Details
-
onComplete
void onComplete(long token, int result, int flags) Called when an operation completes with flags.- Parameters:
token- user data tokenresult- operation result (bytes transferred or negative errno)flags- CQE flags:- IORING_CQE_F_NOTIF (1 << 3) - Zero-copy notification (buffer can be reused)
- IORING_CQE_F_MORE (1 << 1) - More completions coming (multishot active)
-
onComplete
default void onComplete(long token, int result) Description copied from interface:CompletionHandlerCalled when an asynchronous I/O operation completes.Thread Safety: This method is called from the I/O polling thread. Implementations must be thread-safe if the handler is shared across threads.
Performance: This method is on the hot path. Avoid allocations, blocking calls, or expensive computations.
- Specified by:
onCompletein interfaceCompletionHandler- Parameters:
token- the user-defined token passed when the operation was initiated; use this to correlate completions with pending operationsresult- the operation result:- Positive: bytes transferred
- Zero: operation completed with no data
- -1: EOF (peer closed connection)
- Negative: Linux errno (use
-resultto get errno value)
-