pub struct PubOptions {
pub write_buffer_size: usize,
pub write_buffer_linger: Option<Duration>,
/* private fields */
}Fields§
§write_buffer_size: usizeThe size of the write buffer in bytes.
write_buffer_linger: Option<Duration>The linger duration for the write buffer (how long to wait before flushing).
Implementations§
Source§impl PubOptions
impl PubOptions
Source§impl PubOptions
impl PubOptions
Sourcepub fn low_latency() -> Self
pub fn low_latency() -> Self
Creates options optimized for low latency.
Sourcepub fn high_throughput() -> Self
pub fn high_throughput() -> Self
Creates options optimized for high throughput.
Source§impl PubOptions
impl PubOptions
Sourcepub fn with_max_clients(self, max_clients: usize) -> Self
pub fn with_max_clients(self, max_clients: usize) -> Self
Sets the maximum number of concurrent clients.
Sourcepub fn with_high_water_mark(self, hwm: usize) -> Self
pub fn with_high_water_mark(self, hwm: usize) -> Self
Sets the high-water mark per session. This is the amount of messages that can be buffered per session before messages start being dropped.
Sourcepub fn with_min_compress_size(self, min_compress_size: usize) -> Self
pub fn with_min_compress_size(self, min_compress_size: usize) -> Self
Sets the minimum payload size in bytes for compression to be used. If the payload is smaller than this threshold, it will not be compressed.
Sourcepub fn with_write_buffer_size(self, size: usize) -> Self
pub fn with_write_buffer_size(self, size: usize) -> Self
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: 8KiB
Sourcepub fn with_write_buffer_linger(self, duration: Option<Duration>) -> Self
pub fn with_write_buffer_linger(self, duration: Option<Duration>) -> Self
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