final class DefaultSelectStrategy extends java.lang.Object implements SelectStrategy
Modifier and Type | Field and Description |
---|---|
(package private) static SelectStrategy |
INSTANCE |
CONTINUE, SELECT
Modifier | Constructor and Description |
---|---|
private |
DefaultSelectStrategy() |
Modifier and Type | Method and Description |
---|---|
int |
calculateStrategy(IntSupplier selectSupplier,
boolean hasTasks)
The
SelectStrategy can be used to steer the outcome of a potential select
call. |
static final SelectStrategy INSTANCE
public int calculateStrategy(IntSupplier selectSupplier, boolean hasTasks) throws java.lang.Exception
SelectStrategy
SelectStrategy
can be used to steer the outcome of a potential select
call.calculateStrategy
in interface SelectStrategy
selectSupplier
- The supplier with the result of a select result.hasTasks
- true if tasks are waiting to be processed.SelectStrategy.SELECT
if the next step should be blocking select SelectStrategy.CONTINUE
if
the next step should be to not select but rather jump back to the IO loop and try
again. Any value >= 0 is treated as an indicator that work needs to be done.java.lang.Exception