Class FDv2StreamingDataSourceBuilder
Contains methods for configuring the streaming data source.
This class is not stable, and not subject to any backwards compatibility guarantees or semantic versioning. It is not suitable for production usage. Do not use it. You have been warned.
Inherited Members
Namespace: LaunchDarkly.Sdk.Server.Integrations
Assembly: LaunchDarkly.ServerSdk.dll
Syntax
public sealed class FDv2StreamingDataSourceBuilder : IComponentConfigurer<IDataSource>, IDiagnosticDescription
Examples
var config = Configuration.Builder("my-sdk-key")
.DataSystem(Components.DataSystem().Custom()
.Initializers(DataSystemComponents.Polling())
// DataSystemComponents.Streaming returns an instance to this builder.
.Synchronizers(DataSystemComponents.Streaming()
.InitialReconnectDelay(TimeSpan.FromSeconds(5)), DataSystemComponents.Polling())
.FDv1FallbackSynchronizer(DataSystemComponents.FDv1Polling()));
Constructors
View SourceFDv2StreamingDataSourceBuilder()
Declaration
public FDv2StreamingDataSourceBuilder()
Fields
| Edit this page View SourceDefaultInitialReconnectDelay
The default value for InitialReconnectDelay(TimeSpan): 1000 milliseconds.
Declaration
public static readonly TimeSpan DefaultInitialReconnectDelay
Field Value
| Type | Description |
|---|---|
| TimeSpan |
Methods
| Edit this page View SourceBuild(LdClientContext)
Called internally by the SDK to create an implementation instance. Applications should not need to call this method.
Declaration
public IDataSource Build(LdClientContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| LdClientContext | context | provides configuration properties and other components from the current SDK client instance |
Returns
| Type | Description |
|---|---|
| IDataSource | a instance of the component type |
DescribeConfiguration(LdClientContext)
Called internally by the SDK to inspect the configuration. Applications do not need to call this method.
Declaration
public LdValue DescribeConfiguration(LdClientContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| LdClientContext | context | SDK configuration/component information |
Returns
| Type | Description |
|---|---|
| LdValue | a JSON value |
InitialReconnectDelay(TimeSpan)
Sets the initial reconnect delay for the streaming connection.
Declaration
public FDv2StreamingDataSourceBuilder InitialReconnectDelay(TimeSpan initialReconnectDelay)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | initialReconnectDelay | the reconnect time base value |
Returns
| Type | Description |
|---|---|
| FDv2StreamingDataSourceBuilder | the builder |
Remarks
The streaming service uses a backoff algorithm (with jitter) every time the connection needs to be reestablished. The delay for the first reconnection will start near this value, and then increase exponentially for any subsequent connection failures.
The default value is DefaultInitialReconnectDelay.
ServiceEndpointsOverride(ServiceEndpointsBuilder)
Sets overrides for the service endpoints. In typical usage, the data source will use the commonly defined service endpoints, but for cases where they need to be controlled at the source level, this method can be used. This data source will only use the endpoints applicable to it.
Declaration
public FDv2StreamingDataSourceBuilder ServiceEndpointsOverride(ServiceEndpointsBuilder serviceEndpointsOverride)
Parameters
| Type | Name | Description |
|---|---|---|
| ServiceEndpointsBuilder | serviceEndpointsOverride | the service endpoints to override the base endpoints |
Returns
| Type | Description |
|---|---|
| FDv2StreamingDataSourceBuilder | the builder |