Package io.netty.channel
Class DefaultSelectStrategy
- java.lang.Object
-
- io.netty.channel.DefaultSelectStrategy
-
- All Implemented Interfaces:
SelectStrategy
final class DefaultSelectStrategy extends java.lang.Object implements SelectStrategy
Default select strategy.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static SelectStrategyINSTANCE-
Fields inherited from interface io.netty.channel.SelectStrategy
BUSY_WAIT, CONTINUE, SELECT
-
-
Constructor Summary
Constructors Modifier Constructor Description privateDefaultSelectStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcalculateStrategy(IntSupplier selectSupplier, boolean hasTasks)TheSelectStrategycan be used to steer the outcome of a potential select call.
-
-
-
Field Detail
-
INSTANCE
static final SelectStrategy INSTANCE
-
-
Method Detail
-
calculateStrategy
public int calculateStrategy(IntSupplier selectSupplier, boolean hasTasks) throws java.lang.Exception
Description copied from interface:SelectStrategyTheSelectStrategycan be used to steer the outcome of a potential select call.- Specified by:
calculateStrategyin interfaceSelectStrategy- Parameters:
selectSupplier- The supplier with the result of a select result.hasTasks- true if tasks are waiting to be processed.- Returns:
SelectStrategy.SELECTif the next step should be blocking selectSelectStrategy.CONTINUEif 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.- Throws:
java.lang.Exception
-
-