pub struct StreamingDataSourceBuilder { /* private fields */ }
Expand description
Contains methods for configuring the streaming data source.
By default, the SDK uses a streaming connection to receive feature flag data from LaunchDarkly. If you want to customize the behavior of the connection, create a builder StreamingDataSourceBuilder::new, change its properties with the methods of this class, and pass it to crate::ConfigBuilder::data_source.
Examples
Adjust the initial reconnect delay.
ConfigBuilder::new("sdk-key").data_source(StreamingDataSourceBuilder::new()
.initial_reconnect_delay(Duration::from_secs(10)));
Implementations§
source§impl StreamingDataSourceBuilder
impl StreamingDataSourceBuilder
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new instance of the StreamingDataSourceBuilder with default values.
sourcepub fn initial_reconnect_delay(&mut self, duration: Duration) -> &mut Self
pub fn initial_reconnect_delay(&mut self, duration: Duration) -> &mut Self
Sets the initial reconnect delay for the streaming connection.
sourcepub fn https_connector(&mut self, connector: HttpsConnector) -> &mut Self
pub fn https_connector(&mut self, connector: HttpsConnector) -> &mut Self
Sets the eventsource_client::HttpsConnector for the event
source client 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.
Trait Implementations§
source§impl Clone for StreamingDataSourceBuilder
impl Clone for StreamingDataSourceBuilder
source§fn clone(&self) -> StreamingDataSourceBuilder
fn clone(&self) -> StreamingDataSourceBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more