Package io.netty.channel.nio
Interface NioTask<C extends java.nio.channels.SelectableChannel>
-
public interface NioTask<C extends java.nio.channels.SelectableChannel>
An arbitrary task that can be executed byNioEventLoop
when aSelectableChannel
becomes ready.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
channelReady(C ch, java.nio.channels.SelectionKey key)
Invoked when theSelectableChannel
has been selected by theSelector
.void
channelUnregistered(C ch, java.lang.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, java.nio.channels.SelectionKey key) throws java.lang.Exception
Invoked when theSelectableChannel
has been selected by theSelector
.- Throws:
java.lang.Exception
-
channelUnregistered
void channelUnregistered(C ch, java.lang.Throwable cause) throws java.lang.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:
java.lang.Exception
-
-