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.bufferMode(TransportConfig.BufferMode bufferMode) Sets the io_uring buffer strategy (ignored by non-io_uring backends).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 micros) Sets the SQPOLL idle timeout.zeroCopySendMinBytes(int bytes) Sets the minimum payload size (bytes) before attempting SEND_ZC.
-
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
-
bufferMode
Sets the io_uring buffer strategy (ignored by non-io_uring backends). -
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:
micros- idle timeout in microseconds before kernel thread sleeps- Returns:
- this builder for chaining
-
zeroCopySendMinBytes
Sets the minimum payload size (bytes) before attempting SEND_ZC.Use 0 to always attempt SEND_ZC for all payload sizes.
-
build
-