pub struct RepOptions { /* private fields */ }Expand description
The reply socket options.
Implementations§
Source§impl RepOptions
impl RepOptions
Sourcepub fn new(profile: Profile) -> RepOptions
pub fn new(profile: Profile) -> RepOptions
Creates new options based on the given profile.
Sourcepub fn low_latency() -> RepOptions
pub fn low_latency() -> RepOptions
Creates options optimized for low latency.
Sourcepub fn high_throughput() -> RepOptions
pub fn high_throughput() -> RepOptions
Creates options optimized for high throughput.
Sourcepub fn balanced() -> RepOptions
pub fn balanced() -> RepOptions
Creates options optimized for a balanced trade-off between latency and throughput.
Source§impl RepOptions
impl RepOptions
Sourcepub fn with_max_clients(self, max_clients: usize) -> RepOptions
pub fn with_max_clients(self, max_clients: usize) -> RepOptions
Sets the number of maximum concurrent clients.
Sourcepub fn with_min_compress_size(self, min_compress_size: usize) -> RepOptions
pub fn with_min_compress_size(self, min_compress_size: usize) -> RepOptions
Sets the minimum payload size for compression. If the payload is smaller than this value, it will not be compressed.
Default: DEFAULT_BUFFER_SIZE
Sourcepub fn with_write_buffer_size(self, size: usize) -> RepOptions
pub fn with_write_buffer_size(self, size: usize) -> RepOptions
Sets the size (max capacity) of the write buffer in bytes. When the buffer is full, it will be flushed to the underlying transport.
Default: DEFAULT_BUFFER_SIZE
Sourcepub fn with_write_buffer_linger(self, duration: Option<Duration>) -> RepOptions
pub fn with_write_buffer_linger(self, duration: Option<Duration>) -> RepOptions
Sets the linger duration for the write buffer. If None, the write buffer will only be
flushed when the buffer is full.
Default: 100µs
Sourcepub fn with_max_pending_responses(self, hwm: usize) -> RepOptions
pub fn with_max_pending_responses(self, hwm: usize) -> RepOptions
Sets the high-water mark for pending responses per peer. When this limit is reached, new requests will not be read from the underlying connection until pending responses are fulfilled.
Default: DEFAULT_QUEUE_SIZE