The CompositeDataSource can combine a number of DataSystemInitializers and DataSystemSynchronizers into a single DataSource, implementing fallback and recovery logic internally to choose where data is sourced from.

Hierarchy

  • CompositeDataSource

Implements

Constructors

Properties

_backoff: Backoff = ...
_cancelTokens: (() => void)[] = []

Type declaration

    • (): void
    • Returns void

_externalTransitionPromise: Promise<TransitionRequest>
_externalTransitionResolve?: ((value) => void)

Type declaration

    • (value): void
    • Parameters

      • value: TransitionRequest

      Returns void

_initFactories: DataSourceList<LDDataSourceFactory>
_initPhaseActive: boolean
_logger?: LDLogger
_stopped: boolean = true
_syncFactories: DataSourceList<LDDataSourceFactory>
_transitionConditions: TransitionConditions = ...

Methods

  • Parameters

    Returns undefined | {
        durationMS: number;
        transition: Transition;
    }

    the transition condition for the provided data source state or undefined if there is no transition condition

  • Determines the next datasource and returns that datasource as well as a closure to cull the datasource from the datasource lists. One example where the cull closure is invoked is if the datasource has an unrecoverable error.

    Parameters

    • Optional transition: Transition
      Optional

    Returns {
        cullDSFactory: undefined | (() => void);
        dataSource: undefined | DataSource;
        isPrimary: boolean;
    }

    • cullDSFactory: undefined | (() => void)
    • dataSource: undefined | DataSource
    • isPrimary: boolean
  • This wrapper will ensure the following:

    Don't report DataSourceState.Initializing except as first status callback. Map underlying DataSourceState.Closed to interrupted. Don't report the same status and error twice in a row.

    Parameters

    • statusCallback: ((status, err?) => void)
        • (status, err?): void
        • Parameters

          Returns void

    Returns ((status, err?) => void)

      • (status, err?): void
      • This wrapper will ensure the following:

        Don't report DataSourceState.Initializing except as first status callback. Map underlying DataSourceState.Closed to interrupted. Don't report the same status and error twice in a row.

        Parameters

        Returns void

  • May be called any number of times, if already started, has no effect

    Parameters

    • dataCallback: ((basis, data) => void)

      that will be called when data arrives, may be called multiple times.

        • (basis, data): void
        • Parameters

          • basis: boolean
          • data: any

          Returns void

    • statusCallback: ((status, err?) => void)

      that will be called when data source state changes or an unrecoverable error has been encountered.

        • (status, err?): void
        • Parameters

          Returns void

    Returns Promise<void>

Generated using TypeDoc