Module io.netty5.transport
Package io.netty5.channel.nio
Interface NioTask<C extends SelectableChannel>
-
public interface NioTask<C extends SelectableChannel>
An arbitrary task that can be executed byNioHandler
when aSelectableChannel
becomes ready.- See Also:
NioHandler#register(SelectableChannel, int, NioTask)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
channelReady(C ch, SelectionKey key)
Invoked when theSelectableChannel
has been selected by theSelector
.void
channelUnregistered(C ch, Throwable cause)
Invoked when theSelectionKey
of the specifiedSelectableChannel
has been cancelled and thus thisNioTask
will not be notified anymore.
-
-
-
Method Detail
-
channelReady
void channelReady(C ch, SelectionKey key) throws Exception
Invoked when theSelectableChannel
has been selected by theSelector
.- Throws:
Exception
-
channelUnregistered
void channelUnregistered(C ch, Throwable cause) throws Exception
Invoked when theSelectionKey
of the specifiedSelectableChannel
has been cancelled and thus thisNioTask
will not be notified anymore.- Parameters:
cause
- the cause of the unregistration.null
if a user calledSelectionKey.cancel()
or the event loop has been shut down.- Throws:
Exception
-
-