pub struct EventProcessorBuilder<C> { /* private fields */ }
Expand description
Contains methods for configuring delivery of analytics events.
The SDK normally buffers analytics events and sends them to LaunchDarkly at intervals. If you want to customize this behavior, create a builder with crate::EventProcessorBuilder::new, change its properties with the methods of this struct, and pass it to crate::ConfigBuilder::event_processor.
§Examples
Adjust the flush interval
ConfigBuilder::new("sdk-key").event_processor(EventProcessorBuilder::<HttpsConnector<HttpConnector>>::new()
.flush_interval(Duration::from_secs(10)));
Implementations§
Source§impl<C> EventProcessorBuilder<C>
impl<C> EventProcessorBuilder<C>
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new EventProcessorBuilder with all default values.
Sourcepub fn capacity(&mut self, capacity: usize) -> &mut Self
pub fn capacity(&mut self, capacity: usize) -> &mut Self
Set the capacity of the events buffer.
The client buffers up to this many events in memory before flushing. If the capacity is exceeded before the buffer is flushed crate::EventProcessor::flush, events will be discarded. Increasing the capacity means that events are less likely to be discarded, at the cost of consuming more memory.
Sourcepub fn flush_interval(&mut self, flush_interval: Duration) -> &mut Self
pub fn flush_interval(&mut self, flush_interval: Duration) -> &mut Self
Sets the interval between flushes of the event buffer.
Decreasing the flush interval means that the event buffer is less likely to reach capacity.
Sourcepub fn context_keys_capacity(
&mut self,
context_keys_capacity: NonZeroUsize,
) -> &mut Self
pub fn context_keys_capacity( &mut self, context_keys_capacity: NonZeroUsize, ) -> &mut Self
Sets the number of context keys that the event processor can remember at any one time.
To avoid sending duplicate context details in analytics events, the SDK maintains a cache of recently seen context keys.
Sourcepub fn context_keys_flush_interval(
&mut self,
context_keys_flush_interval: Duration,
) -> &mut Self
pub fn context_keys_flush_interval( &mut self, context_keys_flush_interval: Duration, ) -> &mut Self
Sets the interval at which the event processor will reset its cache of known context keys.
Sourcepub fn all_attributes_private(
&mut self,
all_attributes_private: bool,
) -> &mut Self
pub fn all_attributes_private( &mut self, all_attributes_private: bool, ) -> &mut Self
Sets whether or not all optional user attributes should be hidden from LaunchDarkly.
If this is true, all user attribute values (other than the key) will be private, not just the attributes specified with private_attributes or on a per-user basis with UserBuilder methods. By default, it is false.
Sourcepub fn private_attributes<R>(&mut self, attributes: HashSet<R>) -> &mut Self
pub fn private_attributes<R>(&mut self, attributes: HashSet<R>) -> &mut Self
Marks a set of attribute names as always private.
Any users sent to LaunchDarkly with this configuration active will have attributes with these names removed. This is in addition to any attributes that were marked as private for an individual user with UserBuilder methods. Setting all_attribute_private to true overrides this.
Sourcepub fn https_connector(&mut self, connector: C) -> &mut Self
pub fn https_connector(&mut self, connector: C) -> &mut Self
Sets the connector for the event sender to use. This allows for re-use of a connector
between multiple client instances. This is especially useful for the sdk-test-harness
where many client instances are created throughout the test and reading the native
certificates is a substantial portion of the runtime.
Sourcepub fn omit_anonymous_contexts(&mut self, omit: bool) -> &mut Self
pub fn omit_anonymous_contexts(&mut self, omit: bool) -> &mut Self
Sets whether anonymous contexts should be omitted from index and identify events.
The default is false, meaning that anonymous contexts will be included in index and identify events.
Trait Implementations§
Source§impl<C: Clone> Clone for EventProcessorBuilder<C>
impl<C: Clone> Clone for EventProcessorBuilder<C>
Source§fn clone(&self) -> EventProcessorBuilder<C>
fn clone(&self) -> EventProcessorBuilder<C>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<C> Freeze for EventProcessorBuilder<C>where
C: Freeze,
impl<C> !RefUnwindSafe for EventProcessorBuilder<C>
impl<C> Send for EventProcessorBuilder<C>where
C: Send,
impl<C> Sync for EventProcessorBuilder<C>where
C: Sync,
impl<C> Unpin for EventProcessorBuilder<C>where
C: Unpin,
impl<C> !UnwindSafe for EventProcessorBuilder<C>
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
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>
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 more