pub struct SubscriptionConfig {
pub max_per_connection: usize,
pub max_global: usize,
pub max_result_rows: usize,
pub rate_limit_per_second: u32,
pub channel_buffer_size: usize,
pub slow_consumer_threshold_percent: u8,
pub selective_updates: SelectiveColumnConfig,
}Expand description
Configuration for subscription limits, quotas, and backpressure
Provides configurable limits to prevent resource exhaustion attacks and ensure fair resource sharing between clients.
Fields§
§max_per_connection: usizeMaximum subscriptions per connection (default: 100)
Prevents a single client from creating too many subscriptions and monopolizing server resources.
max_global: usizeMaximum subscriptions globally across all connections (default: 10,000)
Sets an upper bound on total subscriptions to ensure predictable memory usage and performance.
max_result_rows: usizeMaximum result set size per subscription in rows (default: 10,000)
Limits memory usage per subscription by capping the number of rows that can be returned.
rate_limit_per_second: u32Rate limit: subscriptions per second per connection (default: 10)
Prevents rapid subscription creation that could degrade performance.
channel_buffer_size: usizeChannel buffer size per subscription (default: 64) Larger values reduce chance of drops but use more memory. Smaller values detect slow consumers faster.
slow_consumer_threshold_percent: u8Slow consumer threshold as percentage of buffer full (default: 80) When channel depth exceeds this percentage, warn about slow consumer
selective_updates: SelectiveColumnConfigConfiguration for selective column updates
Controls when the server sends partial row updates (only changed columns) instead of full rows, reducing bandwidth for wide tables with few changes.
Trait Implementations§
Source§impl Clone for SubscriptionConfig
impl Clone for SubscriptionConfig
Source§fn clone(&self) -> SubscriptionConfig
fn clone(&self) -> SubscriptionConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SubscriptionConfig
impl Debug for SubscriptionConfig
Source§impl Default for SubscriptionConfig
impl Default for SubscriptionConfig
Source§impl<'de> Deserialize<'de> for SubscriptionConfig
impl<'de> Deserialize<'de> for SubscriptionConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for SubscriptionConfig
impl RefUnwindSafe for SubscriptionConfig
impl Send for SubscriptionConfig
impl Sync for SubscriptionConfig
impl Unpin for SubscriptionConfig
impl UnsafeUnpin for SubscriptionConfig
impl UnwindSafe for SubscriptionConfig
Blanket Implementations§
impl<T> Allocation for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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>
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>
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>
T in a tonic::Request