@launchdarkly/js-server-sdk-common - v2.26.1
    Preparing search index...

    Interface LDMigrationOptions<TMigrationRead, TMigrationWrite, TMigrationReadInput, TMigrationWriteInput>

    Configuration for a migration.

    interface LDMigrationOptions<
        TMigrationRead,
        TMigrationWrite,
        TMigrationReadInput,
        TMigrationWriteInput,
    > {
        check?: (a: TMigrationRead, b: TMigrationRead) => boolean;
        errorTracking?: boolean;
        execution?: LDSerialExecution | LDConcurrentExecution;
        latencyTracking?: boolean;
        readNew: (
            payload?: TMigrationReadInput,
        ) => Promise<LDMethodResult<TMigrationRead>>;
        readOld: (
            payload?: TMigrationReadInput,
        ) => Promise<LDMethodResult<TMigrationRead>>;
        writeNew: (
            payload?: TMigrationWriteInput,
        ) => Promise<LDMethodResult<TMigrationWrite>>;
        writeOld: (
            payload?: TMigrationWriteInput,
        ) => Promise<LDMethodResult<TMigrationWrite>>;
    }

    Type Parameters

    • TMigrationRead
    • TMigrationWrite
    • TMigrationReadInput
    • TMigrationWriteInput
    Index
    check?: (a: TMigrationRead, b: TMigrationRead) => boolean

    Method used to do consistency checks for read operations. After a read operation, during which both data sources are read from, a check of read consistency may be done using this method.

    errorTracking?: boolean

    Configure the error tracking for the migration.

    Defaults to true.

    Configure how the migration should execute. If omitted the execution will be concurrent.

    latencyTracking?: boolean

    Configure the latency tracking for the migration.

    Defaults to true.

    readNew: (
        payload?: TMigrationReadInput,
    ) => Promise<LDMethodResult<TMigrationRead>>

    Implementation which provides a read from the "new" source.

    Users are required to provide two different read methods -- one to read from the old migration source, and one to read from the new source. Additionally, customers can opt-in to consistency tracking by providing a check function.

    Depending on the migration stage, one or both of these read methods may be called.

    Throwing an exception from this method will be treated as an error.

    Type Declaration

    readOld: (
        payload?: TMigrationReadInput,
    ) => Promise<LDMethodResult<TMigrationRead>>

    Implementation which provides a read from the "old" source.

    Users are required to provide two different read methods -- one to read from the old migration source, and one to read from the new source. Additionally, customers can opt-in to consistency tracking by providing a check function.

    Depending on the migration stage, one or both of these read methods may be called.

    Throwing an exception from this method will be treated as an error.

    writeNew: (
        payload?: TMigrationWriteInput,
    ) => Promise<LDMethodResult<TMigrationWrite>>

    Implementation which provides a write to the "new" source.

    Users are required to provide two different write methods -- one to write to the old migration source, and one to write to the new source. Not every stage requires

    Depending on the migration stage, one or both of these write methods may be called.

    Throwing an exception from this method will be treated as an error.

    Type Declaration

    writeOld: (
        payload?: TMigrationWriteInput,
    ) => Promise<LDMethodResult<TMigrationWrite>>

    Implementation which provides a write to the "old" source.

    Users are required to provide two different write methods -- one to write to the old migration source, and one to write to the new source. Not every stage requires

    Depending on the migration stage, one or both of these write methods may be called.

    Throwing an exception from this method will be treated as an error.

    Type Declaration