public class SelectorIterable extends Object implements Iterable<SelectionKey>
Selector.selectedKeys() as an Iterable, removing them from the
selected set as they're iterated over.| Modifier and Type | Class and Description |
|---|---|
static interface |
SelectorIterable.SelectFailureHandler
An interface for hearing about catastrophic selection failure.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_SELECT_FAILURES
The maximum allowed consecutive select() failures, after which we will declare ourselves
irreparably hosed.
|
| Constructor and Description |
|---|
SelectorIterable(Selector selector,
int selectLoopTime,
SelectorIterable.SelectFailureHandler handler)
Creates an iterable for the given selector's selectedKeys.
|
| Modifier and Type | Method and Description |
|---|---|
Iterator<SelectionKey> |
iterator() |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic static final int MAX_SELECT_FAILURES
public SelectorIterable(Selector selector, int selectLoopTime, SelectorIterable.SelectFailureHandler handler)
selectLoopTime - - the amount of time to wait in select, or 0 to skip the wait at all.handler - - a callback for the Selector going awol.public Iterator<SelectionKey> iterator()
iterator in interface Iterable<SelectionKey>Copyright © 2015. All rights reserved.