Top Description Methods
io.netty5.channel

public Interface IoHandler

Known Direct Implementers
io.netty5.channel.local.LocalHandler, io.netty5.channel.nio.NioHandler

Handles IO dispatching for an EventLoop All operations except wakeup(boolean) and isCompatible(Class) MUST be executed on the EventLoop thread and should never be called from the user-directly.

Method Summary

Modifier and TypeMethod and Description
public void
deregister(IoHandle
the IoHandle to deregister..
handle
)

Deregister a IoHandle for IO.

public void
destroy()

Destroy the IoHandler and free all its resources.

public boolean

Returns:

if compatible of not.
isCompatible
(Class<? extends IoHandle>
the type of the IoHandle.
handleType
)

Returns true if the given type is compatible with this IoHandler and so can be registered, false otherwise.

public void
prepareToDestroy()

Prepare to destroy this IoHandler.

public void
register(IoHandle
the Channel to register..
channel
)

Register a Channel for IO.

public int

Returns:

the number of IoHandle for which I/O was handled.
run
(IoExecutionContext context)

Run the IO handled by this IoHandler.

public void
wakeup(boolean inEventLoop)

Wakeup the IoHandler, which means if any operation blocks it should be unblocked and return as soon as possible.

Method Detail

deregisterback to summary
public void deregister(IoHandle handle) throws Exception

Deregister a IoHandle for IO.

Parameters
handle:IoHandle

the IoHandle to deregister..

Exceptions
Exception:
thrown if an error happens during deregistration.
destroyback to summary
public void destroy()

Destroy the IoHandler and free all its resources.

isCompatibleback to summary
public boolean isCompatible(Class<? extends IoHandle> handleType)

Returns true if the given type is compatible with this IoHandler and so can be registered, false otherwise.

Parameters
handleType:Class<? extends IoHandle>

the type of the IoHandle.

Returns:boolean

if compatible of not.

prepareToDestroyback to summary
public void prepareToDestroy()

Prepare to destroy this IoHandler. This method will be called before destroy() and may be called multiple times.

registerback to summary
public void register(IoHandle channel) throws Exception

Register a Channel for IO.

Parameters
channel:IoHandle

the Channel to register..

Exceptions
Exception:
thrown if an error happens during registration.
runback to summary
public int run(IoExecutionContext context)

Run the IO handled by this IoHandler. The IoExecutionContext should be used to ensure we not execute too long and so block the processing of other task that are scheduled on the EventLoop. This is done by taking IoExecutionContext#delayNanos(long) or IoExecutionContext#deadlineNanos() into account.

Returns:int

the number of IoHandle for which I/O was handled.

wakeupback to summary
public void wakeup(boolean inEventLoop)

Wakeup the IoHandler, which means if any operation blocks it should be unblocked and return as soon as possible.