Package io.servicetalk.transport.api
Class TransportConfigBuilder
java.lang.Object
io.servicetalk.transport.api.TransportConfigBuilder
Builder for
TransportConfig
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newTransportConfig
.maxBytesPerRead
(int maxBytesPerRead) Sets maximum number of bytes per read operation.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.
-
Constructor Details
-
TransportConfigBuilder
public TransportConfigBuilder()
-
-
Method Details
-
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
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
Builds a newTransportConfig
.- Returns:
- a new
TransportConfig
-