Type Alias ICircuitBreakerStorageAdapter<TType>

ICircuitBreakerStorageAdapter: {
    find(key: string): Promise<null | TType>;
    remove(key: string): Promise<void>;
    transaction<TValue>(
        fn: InvokableFn<
            [transaction: ICircuitBreakerStorageAdapterTransaction<TType>],
            Promise<TValue>,
        >,
    ): Promise<TValue>;
}

The ICircuitBreakerStorageAdapter contract defines a way for storing circuit breaker state independent of the underlying technology. This contract simplifies the implementation of circuit breaker adapters with CRUD-based databases, such as SQL databases and ORMs like TypeOrm and MikroOrm.

IMPORT_PATH: "@daiso-tech/core/circuit-breaker/contracts"

Type Parameters

  • TType = unknown

Type declaration