LaunchDarkly Dotnet Client SDK
Search Results for

    Show / Hide Table of Contents

    Class PollingDataSourceBuilder

    Contains methods for configuring the polling data source.

    Inheritance
    object
    PollingDataSourceBuilder
    Implements
    IComponentConfigurer<IDataSource>
    IDiagnosticDescription
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: LaunchDarkly.Sdk.Client.Integrations
    Assembly: LaunchDarkly.ClientSdk.dll
    Syntax
    public sealed class PollingDataSourceBuilder : IComponentConfigurer<IDataSource>, IDiagnosticDescription
    Remarks

    Polling is not the default behavior; by default, the SDK uses a streaming connection to receive feature flag data from LaunchDarkly. In polling mode, the SDK instead makes a new HTTP request to LaunchDarkly at regular intervals. HTTP caching allows it to avoid redundantly downloading data if there have been no changes, but polling is still less efficient than streaming and should only be used on the advice of LaunchDarkly support.

    To use polling mode, create a builder with PollingDataSource(), change its properties with the methods of this class, and pass it to DataSource(IComponentConfigurer<IDataSource>).

    Setting Offline(bool) to true will supersede this setting and completely disable network requests.

    Examples
    var config = Configuration.Builder(sdkKey)
        .DataSource(Components.PollingDataSource()
            .PollInterval(TimeSpan.FromSeconds(45)))
        .Build();

    Constructors

    View Source

    PollingDataSourceBuilder()

    Declaration
    public PollingDataSourceBuilder()

    Fields

    | Edit this page View Source

    DefaultPollInterval

    The default value for PollInterval(TimeSpan): 5 minutes.

    Declaration
    public static readonly TimeSpan DefaultPollInterval
    Field Value
    Type Description
    TimeSpan

    Methods

    | Edit this page View Source

    BackgroundPollInterval(TimeSpan)

    Sets the interval between feature flag updates when the application is running in the background.

    Declaration
    public PollingDataSourceBuilder BackgroundPollInterval(TimeSpan backgroundPollInterval)
    Parameters
    Type Name Description
    TimeSpan backgroundPollInterval

    the background polling interval

    Returns
    Type Description
    PollingDataSourceBuilder

    the same builder

    Remarks

    This is only relevant on mobile platforms. The default is DefaultBackgroundPollInterval; the minimum is MinimumBackgroundPollInterval.

    See Also
    EnableBackgroundUpdating(bool)
    | Edit this page View Source

    Build(LdClientContext)

    Called internally by the SDK to create an implementation instance. Applications should not need to call this method.

    Declaration
    public IDataSource Build(LdClientContext clientContext)
    Parameters
    Type Name Description
    LdClientContext clientContext
    Returns
    Type Description
    IDataSource

    a instance of the component type

    | Edit this page View Source

    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

    the context object that may provide relevant configuration details

    Returns
    Type Description
    LdValue

    a JSON value

    | Edit this page View Source

    PollInterval(TimeSpan)

    Sets the interval at which the SDK will poll for feature flag updates.

    Declaration
    public PollingDataSourceBuilder PollInterval(TimeSpan pollInterval)
    Parameters
    Type Name Description
    TimeSpan pollInterval

    the polling interval

    Returns
    Type Description
    PollingDataSourceBuilder

    the builder

    Remarks

    The default and minimum value is DefaultPollInterval. Values less than this will be set to the default.

    Implements

    IComponentConfigurer<T>
    IDiagnosticDescription
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX