pub struct AggregatorConfigBuilder { /* private fields */ }Expand description
Builder for AggregatorConfig.
Implementations§
Source§impl AggregatorConfigBuilder
impl AggregatorConfigBuilder
Sourcepub fn complete_when_size(self, n: usize) -> Self
pub fn complete_when_size(self, n: usize) -> Self
Emit when bucket has N exchanges.
Sourcepub fn complete_when<F>(self, predicate: F) -> Self
pub fn complete_when<F>(self, predicate: F) -> Self
Emit when predicate returns true for the current bucket.
Sourcepub fn complete_on_timeout(self, duration: Duration) -> Self
pub fn complete_on_timeout(self, duration: Duration) -> Self
Emit when the bucket has been inactive for the given duration.
Sourcepub fn complete_on_size_or_timeout(self, size: usize, timeout: Duration) -> Self
pub fn complete_on_size_or_timeout(self, size: usize, timeout: Duration) -> Self
Emit when the bucket reaches size OR has been inactive for timeout.
Sourcepub fn force_completion_on_stop(self, enabled: bool) -> Self
pub fn force_completion_on_stop(self, enabled: bool) -> Self
Enable force-completion of pending buckets when the route is stopped.
Sourcepub fn discard_on_timeout(self, enabled: bool) -> Self
pub fn discard_on_timeout(self, enabled: bool) -> Self
Discard bucket contents on timeout instead of emitting the aggregated exchange.
Sourcepub fn correlate_by(self, header: impl Into<String>) -> Self
pub fn correlate_by(self, header: impl Into<String>) -> Self
Override the correlation strategy with a header-based key.
Sourcepub fn strategy(self, strategy: AggregationStrategy) -> Self
pub fn strategy(self, strategy: AggregationStrategy) -> Self
Override the default CollectAll aggregation strategy.
Sourcepub fn max_buckets(self, max: usize) -> Self
pub fn max_buckets(self, max: usize) -> Self
Set the maximum number of correlation key buckets. When the limit is reached, new correlation keys are rejected with an error.
Sourcepub fn bucket_ttl(self, ttl: Duration) -> Self
pub fn bucket_ttl(self, ttl: Duration) -> Self
Set the time-to-live for inactive buckets. Buckets that haven’t been updated for this duration will be evicted.
Sourcepub fn build(self) -> AggregatorConfig
pub fn build(self) -> AggregatorConfig
Build the config. Panics if no completion condition was set.