java.io.Closeable, java.lang.AutoCloseablepublic class SocketSelector extends ESSelector
NioSocketChannel. It's main piece of functionality is
handling connect, read, and write events.| Constructor | Description |
|---|---|
SocketSelector(SocketEventHandler eventHandler) |
|
SocketSelector(SocketEventHandler eventHandler,
java.nio.channels.Selector selector) |
| Modifier and Type | Method | Description |
|---|---|---|
<V> void |
executeFailedListener(ActionListener<V> listener,
java.lang.Exception exception) |
Executes a failed listener with consistent exception handling.
|
<V> void |
executeListener(ActionListener<V> listener,
V value) |
Executes a success listener with consistent exception handling.
|
void |
queueWrite(WriteOperation writeOperation) |
Queues a write operation to be handled by the event loop.
|
void |
queueWriteInChannelBuffer(WriteOperation writeOperation) |
Queues a write operation directly in a channel's buffer.
|
void |
scheduleForRegistration(NioSocketChannel nioSocketChannel) |
Schedules a NioSocketChannel to be registered by this selector.
|
close, isOnCurrentThread, isOpen, isRunning, isRunningFuture, queueChannelClose, rawSelector, runLooppublic SocketSelector(SocketEventHandler eventHandler) throws java.io.IOException
java.io.IOExceptionpublic SocketSelector(SocketEventHandler eventHandler, java.nio.channels.Selector selector) throws java.io.IOException
java.io.IOExceptionpublic void scheduleForRegistration(NioSocketChannel nioSocketChannel)
nioSocketChannel - the channel to registerpublic void queueWrite(WriteOperation writeOperation)
writeOperation - to be queuedpublic void queueWriteInChannelBuffer(WriteOperation writeOperation)
writeOperation - to be queued in a channel's bufferpublic <V> void executeListener(ActionListener<V> listener, V value)
listener - to be executedvalue - to provide to listenerpublic <V> void executeFailedListener(ActionListener<V> listener, java.lang.Exception exception)
listener - to be executedexception - to provide to listener