pub struct StreamClientConfig {
pub connection: ConnectionConfig,
pub backpressure: BackpressureConfig,
pub enable_metrics: bool,
}
Expand description
Common client configuration
Fields§
§connection: ConnectionConfig
Connection configuration
backpressure: BackpressureConfig
Backpressure configuration
enable_metrics: bool
Whether performance monitoring is enabled (default: false)
Implementations§
Source§impl StreamClientConfig
impl StreamClientConfig
Sourcepub fn high_throughput() -> Self
pub fn high_throughput() -> Self
Creates a high-throughput configuration optimized for high-concurrency scenarios.
This configuration prioritizes throughput over latency by:
- Implementing a drop strategy for backpressure to avoid blocking
- Setting a large permit buffer (5,000) to handle burst traffic
Ideal for scenarios where you need to process large volumes of data and can tolerate occasional message drops during peak loads.
Sourcepub fn low_latency() -> Self
pub fn low_latency() -> Self
Creates a low-latency configuration optimized for real-time scenarios.
This configuration prioritizes latency over throughput by:
- Processing events immediately without buffering
- Implementing a blocking backpressure strategy to ensure no data loss
- Setting optimal permits (4000) for balanced throughput and latency
Ideal for scenarios where every millisecond counts and you cannot afford to lose any events, such as trading applications or real-time monitoring.
Trait Implementations§
Source§impl Clone for StreamClientConfig
impl Clone for StreamClientConfig
Source§fn clone(&self) -> StreamClientConfig
fn clone(&self) -> StreamClientConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for StreamClientConfig
impl Debug for StreamClientConfig
Auto Trait Implementations§
impl Freeze for StreamClientConfig
impl RefUnwindSafe for StreamClientConfig
impl Send for StreamClientConfig
impl Sync for StreamClientConfig
impl Unpin for StreamClientConfig
impl UnwindSafe for StreamClientConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request