Class TransportConfigBuilder

java.lang.Object
io.servicetalk.transport.api.TransportConfigBuilder

public final class TransportConfigBuilder extends Object
Builder for TransportConfig.
  • Constructor Details

    • TransportConfigBuilder

      public TransportConfigBuilder()
  • Method Details

    • maxReadAttemptsPerSelect

      public TransportConfigBuilder maxReadAttemptsPerSelect(int maxReadAttemptsPerSelect)
      Sets maximum number of times the transport will attempt to read data when the selector notifies that there is read data pending.

      The value must be positive. If this value is greater than 1, the transport might attempt to read multiple times to procure multiple messages.

      Parameters:
      maxReadAttemptsPerSelect - Maximum number of times the transport will attempt to read data when the selector notifies that there is read data pending
      Returns:
      this
      See Also:
    • maxBytesPerRead

      public TransportConfigBuilder maxBytesPerRead(int maxBytesPerRead)
      Sets maximum number of bytes per read operation.

      The transport may gradually increase the expected number of readable bytes up to this value if the previous read fully filled the allocated buffer. It may also gradually decrease the expected number of readable bytes if the read operation was not able to fill a predicted amount of the allocated bytes some number of times consecutively.

      The value must be positive.

      Parameters:
      maxBytesPerRead - Maximum number of bytes per read operation
      Returns:
      this
      See Also:
    • build

      public TransportConfig build()
      Builds a new TransportConfig.
      Returns:
      a new TransportConfig