pub struct StreamBufferConfig {
pub topic: String,
pub correlation_id: Option<String>,
pub capacity: Option<usize>,
}Expand description
Configuration for the correlated in-process stream response buffer.
Fields§
§topic: StringShared buffer topic used by both the publisher and correlated consumers.
correlation_id: Option<String>Consumer-only correlation id partition to read from.
Leave this unset for the publisher endpoint configured in
HttpConfig::stream_response_to. Set it on consumers so a reader only
receives messages belonging to one request or response stream.
capacity: Option<usize>Capacity of each correlation partition. Defaults to 100.
Implementations§
Source§impl StreamBufferConfig
impl StreamBufferConfig
Sourcepub fn new(topic: impl Into<String>) -> Self
pub fn new(topic: impl Into<String>) -> Self
Creates a stream_buffer config for the given topic.
Add with_correlation_id when constructing a consumer for one stream.
Leave the correlation id unset when constructing the publisher buffer
used by HttpConfig::stream_response_to.
Sourcepub fn with_correlation_id(self, correlation_id: impl Into<String>) -> Self
pub fn with_correlation_id(self, correlation_id: impl Into<String>) -> Self
Selects the response stream partition that a consumer should read.
Sourcepub fn with_capacity(self, capacity: usize) -> Self
pub fn with_capacity(self, capacity: usize) -> Self
Sets the per-correlation partition capacity.
Trait Implementations§
Source§impl Clone for StreamBufferConfig
impl Clone for StreamBufferConfig
Source§fn clone(&self) -> StreamBufferConfig
fn clone(&self) -> StreamBufferConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more