layered-loader
Version:
Data loader with support for caching and fallback data sources
14 lines (13 loc) • 838 B
TypeScript
import type { SynchronousCache, SynchronousGroupCache } from '../types/SyncDataSources';
import type { Logger } from '../util/Logger';
export type ConsumerErrorHandler = (err: Error, channel: string, logger: Logger) => void;
export declare const DEFAULT_NOTIFICATION_ERROR_HANDLER: ConsumerErrorHandler;
export declare abstract class AbstractNotificationConsumer<LoadedValue, InMemoryCacheType extends SynchronousCache<LoadedValue> | SynchronousGroupCache<LoadedValue> = SynchronousCache<LoadedValue>> {
protected targetCache: InMemoryCacheType;
readonly errorHandler: ConsumerErrorHandler;
serverUuid: string;
constructor(serverUuid: string, errorHandler?: ConsumerErrorHandler);
setTargetCache(targetCache: InMemoryCacheType): void;
abstract subscribe(): Promise<unknown>;
abstract close(): Promise<void>;
}