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

  • Parameters

    • initializers: LDDataSourceFactory[]

      factories to create DataSystemInitializers, in priority order.

    • synchronizers: LDDataSourceFactory[]

      factories to create DataSystemSynchronizers, in priority order.

    • Optional _logger: LDLogger
      Optional
    • Optional _transitionConditions: TransitionConditions
      Optional
    • Optional _backoff: Backoff
      Optional

    Returns CompositeDataSource

Properties

_backoff: any
_cancelTokens: any
_cancellableDelay: any
_consumeCancelToken: any
_externalTransitionPromise: any
_externalTransitionResolve?: any
_initFactories: any
_initPhaseActive: any
_logger?: any
_lookupTransitionCondition: any

Returns

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

_pickDataSource: any

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.

_reset: any
_stopped: any
_syncFactories: any
_transitionConditions: any
_wrapStatusCallbackWithSanitizer: any

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.

Methods

  • 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>

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

    Returns Promise<void>

Generated using TypeDoc