Class TransportConfig.Builder
java.lang.Object
express.mvp.myra.transport.TransportConfig.Builder
- Enclosing class:
TransportConfig
Builder for constructing
TransportConfig instances.
All parameters have sensible defaults. Only override what you need.\n
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbackendType(TransportConfig.BackendType backendType) Sets the I/O backend type.build()Builds the configuration.connectionTimeout(Duration timeout) Sets the TCP connection timeout.cpuAffinity(int cpuId) Sets the CPU affinity for the I/O thread.Sets the registered buffer pool configuration.sqPollCpuAffinity(int cpuId) Sets the CPU affinity for the SQPOLL kernel thread.sqPollEnabled(boolean enabled) Enables or disables SQPOLL mode.sqPollIdleTimeout(int millis) Sets the SQPOLL idle timeout.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
backendType
Sets the I/O backend type.- Parameters:
backendType- the backend to use- Returns:
- this builder for chaining
- Throws:
NullPointerException- if backendType is null
-
registeredBuffers
Sets the registered buffer pool configuration.- Parameters:
config- the buffer configuration- Returns:
- this builder for chaining
- Throws:
NullPointerException- if config is null
-
connectionTimeout
Sets the TCP connection timeout.- Parameters:
timeout- the connection timeout- Returns:
- this builder for chaining
- Throws:
NullPointerException- if timeout is null
-
cpuAffinity
Sets the CPU affinity for the I/O thread.- Parameters:
cpuId- the CPU core to pin to, or -1 for no affinity- Returns:
- this builder for chaining
-
sqPollCpuAffinity
Sets the CPU affinity for the SQPOLL kernel thread.Only used when
sqPollEnabled(boolean)is true.- Parameters:
cpuId- the CPU core to pin to, or -1 for no affinity- Returns:
- this builder for chaining
-
sqPollEnabled
Enables or disables SQPOLL mode.SQPOLL creates a dedicated kernel thread for submission polling, eliminating syscall overhead. Uses one CPU core continuously.
- Parameters:
enabled- true to enable SQPOLL- Returns:
- this builder for chaining
-
sqPollIdleTimeout
Sets the SQPOLL idle timeout.- Parameters:
millis- idle timeout in milliseconds before kernel thread sleeps- Returns:
- this builder for chaining
-
build
-