Interface NioTask<C extends SelectableChannel>
public interface NioTask<C extends SelectableChannel>
An arbitrary task that can be executed by
NioEventLoop when a SelectableChannel becomes ready.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidchannelReady(C ch, SelectionKey key) Invoked when theSelectableChannelhas been selected by theSelector.voidchannelUnregistered(C ch, Throwable cause) Invoked when theSelectionKeyof the specifiedSelectableChannelhas been cancelled and thus thisNioTaskwill not be notified anymore.
-
Method Details
-
channelReady
Invoked when theSelectableChannelhas been selected by theSelector.- Throws:
Exception
-
channelUnregistered
Invoked when theSelectionKeyof the specifiedSelectableChannelhas been cancelled and thus thisNioTaskwill not be notified anymore.- Parameters:
cause- the cause of the unregistration.nullif a user calledSelectionKey.cancel()or the event loop has been shut down.- Throws:
Exception
-