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 final SelectStrategy
     

    Fields inherited from interface SelectStrategy

    BUSY_WAIT, CONTINUE, SELECT
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    calculateStrategy(IntSupplier selectSupplier, boolean hasTasks)
    The SelectStrategy can be used to steer the outcome of a potential select call.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • DefaultSelectStrategy

      private DefaultSelectStrategy()
  • Method Details

    • calculateStrategy

      public int calculateStrategy(IntSupplier selectSupplier, boolean hasTasks) throws java.lang.Exception
      Description copied from interface: SelectStrategy
      The SelectStrategy can be used to steer the outcome of a potential select call.
      Specified by:
      calculateStrategy in interface SelectStrategy
      Parameters:
      selectSupplier - The supplier with the result of a select result.
      hasTasks - true if tasks are waiting to be processed.
      Returns:
      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.
      Throws:
      java.lang.Exception