Class IoUringIoHandler
java.lang.Object
io.netty.channel.uring.IoUringIoHandler
- All Implemented Interfaces:
IoHandler
-
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Destroy theIoHandlerand free all its resources.voidInitialize thisIoHandler.booleanisCompatible(Class<? extends IoHandle> handleType) Returnstrueif the given type is compatible with thisIoHandlerand so can be registered,falseotherwise.static IoHandlerFactoryCreate a newIoHandlerFactorythat can be used to createIoUringIoHandlers.static IoHandlerFactorynewFactory(int ringSize) Create a newIoHandlerFactorythat can be used to createIoUringIoHandlers.static IoHandlerFactorynewFactory(IoUringIoHandlerConfig config) Create a newIoHandlerFactorythat can be used to createIoUringIoHandlers.voidPrepare to destroy thisIoHandler.Register aIoHandlefor IO.intrun(IoHandlerContext context) Run the IO handled by thisIoHandler.voidwakeup()Wakeup theIoHandler, which means if any operation blocks it should be unblocked and return as soon as possible.
-
Method Details
-
initialize
public void initialize()Description copied from interface:IoHandlerInitialize thisIoHandler.- Specified by:
initializein interfaceIoHandler
-
run
Description copied from interface:IoHandlerRun the IO handled by thisIoHandler. TheIoHandlerContextshould be used to ensure we not execute too long and so block the processing of other task that are scheduled on theThreadAwareExecutor. This is done by takingIoHandlerContext.delayNanos(long)orIoHandlerContext.deadlineNanos()into account.- Specified by:
runin interfaceIoHandler- Parameters:
context- theIoHandlerContext.- Returns:
- the number of
IoHandlefor which I/O was handled.
-
prepareToDestroy
public void prepareToDestroy()Description copied from interface:IoHandlerPrepare to destroy thisIoHandler. This method will be called beforeIoHandler.destroy()and may be called multiple times.- Specified by:
prepareToDestroyin interfaceIoHandler
-
destroy
-
register
-
wakeup
-
isCompatible
Description copied from interface:IoHandlerReturnstrueif the given type is compatible with thisIoHandlerand so can be registered,falseotherwise.- Specified by:
isCompatiblein interfaceIoHandler- Parameters:
handleType- the type of theIoHandle.- Returns:
- if compatible of not.
-
newFactory
Create a newIoHandlerFactorythat can be used to createIoUringIoHandlers.- Returns:
- factory
-
newFactory
Create a newIoHandlerFactorythat can be used to createIoUringIoHandlers. EachIoUringIoHandlerwill use a ring of sizeringSize.- Parameters:
ringSize- the size of the ring.- Returns:
- factory
-
newFactory
Create a newIoHandlerFactorythat can be used to createIoUringIoHandlers. EachIoUringIoHandlerwill use same option- Parameters:
config- the io_uring configuration- Returns:
- factory
-