Top Description Fields Methods
io.netty.channel

public Interface SelectStrategy

Known Direct Implementers
io.netty.channel.DefaultSelectStrategy
Imports
io.netty.util.IntSupplier

Select strategy interface. Provides the ability to control the behavior of the select loop. For example a blocking select operation can be delayed or skipped entirely if there are events to process immediately.

Field Summary

Modifier and TypeField and Description
public static final int
BUSY_WAIT

Indicates the IO loop to poll for new events without blocking.

public static final int
CONTINUE

Indicates the IO loop should be retried, no blocking select to follow directly.

public static final int
SELECT

Indicates a blocking select should follow.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

SELECT if the next step should be blocking select 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.
calculateStrategy
(IntSupplier
The supplier with the result of a select result.
selectSupplier
,
boolean
true if tasks are waiting to be processed.
hasTasks
)

The SelectStrategy can be used to steer the outcome of a potential select call.

Field Detail

BUSY_WAITback to summary
public static final int BUSY_WAIT

Indicates the IO loop to poll for new events without blocking.

CONTINUEback to summary
public static final int CONTINUE

Indicates the IO loop should be retried, no blocking select to follow directly.

SELECTback to summary
public static final int SELECT

Indicates a blocking select should follow.

Method Detail

calculateStrategyback to summary
public int calculateStrategy(IntSupplier selectSupplier, boolean hasTasks) throws Exception

The SelectStrategy can be used to steer the outcome of a potential select call.

Parameters
selectSupplier:IntSupplier

The supplier with the result of a select result.

hasTasks:boolean

true if tasks are waiting to be processed.

Returns:int

SELECT if the next step should be blocking select 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.