import { EventEmitter } from "node:events"; import { RedisAdapter } from "@myunisoft/redis"; import { type Logger } from "pino"; import { TransactionStore } from "./store/transaction.class.js"; import type { GenericEvent, RegisteredIncomer } from "../types/index.js"; import { type StandardLog } from "../utils/index.js"; import { IncomerStore } from "./store/incomer.class.js"; import { type customValidationCbFn, eventsValidationFn as EventsValidationFn } from "./events.class.js"; import { EventsService } from "./service/events.service.js"; export declare const DISPATCHER_CHANNEL_NAME = "dispatcher"; export declare const RESOLVE_TRANSACTION_INTERVAL: number; export declare const PING_INTERVAL: number; export type DispatcherOptions = { redis: RedisAdapter; subscriber: RedisAdapter; eventsValidation?: { eventsValidationFn?: EventsValidationFn; customValidationCbFn?: customValidationCbFn; }; incomerUUID?: string; name: string; checkLastActivityInterval?: number; checkTransactionInterval?: number; logger?: Logger; standardLog?: StandardLog; pingInterval?: number; idleTime?: number; }; export declare class Dispatcher extends EventEmitter { #private; readonly type = "dispatcher"; readonly dispatcherChannelName: string; readonly privateUUID: `${string}-${string}-${string}-${string}-${string}`; readonly idleTime: number; readonly incomerStore: IncomerStore; readonly dispatcherTransactionStore: TransactionStore<"dispatcher">; readonly backupDispatcherTransactionStore: TransactionStore<"dispatcher">; readonly backupIncomerTransactionStore: TransactionStore<"incomer">; eventsService: EventsService; private subscriber; constructor(options: DispatcherOptions); initialize(): Promise; close(): Promise; handleMessages(channel: string, message: string): Promise; takeLead(opts?: { incomers?: RegisteredIncomer[]; }): Promise; private updateState; private checkLeadState; private takeLeadBack; private randomIntFromTimeoutRange; private checkLastActivity; private ping; private removeNonActives; private setAsActiveDispatcher; private setAsInactiveDispatcher; private handleRetryEvent; private handleCustomEvents; private dispatchEventToIncomer; private getFilteredConcernedIncomers; private backupUndeliverableEvents; private approveIncomer; } //# sourceMappingURL=dispatcher.class.d.ts.map