import { Logger } from "../../adapters/logger/Logger"; /** * Recurrence service that uses node-cron to schedule recurrent routines executions. * Usage: * const recurrenceServiceName = new RecurrenceService(loggerAdapter); * recurrenceServiceName.scheduleMinutes("myProcessName", ()=> {logger.info("running myProcessName...")}, 10); * It is safe to create multiple instances of the same recurrenceService as needed. There is no need of unsubscribing * when servers shuts down. */ export declare class RecurrenceService { private readonly logger; /** * Creates a new instance of the @Logger implementation in the project you are referencing this * service. * @param logger the logger implementation. */ constructor(logger: Logger); /** * Schedules a routine to be executed each @minutes * @param processName the process name (used for logging purposes) * @param routine the function to be executed (supports async functions) * @param minutesInterval the interval in minutes to trigger the @routine */ scheduleMinutes(processName: string, routine: Function, minutesInterval: Number): void; /** * Schedules a routine to be executed each @minutes * @param processName the process name (used for logging purposes) * @param routine the function to be executed (supports async functions) * @param secondsInterval the interval in seconds to trigger the @routine */ scheduleSeconds(processName: string, routine: Function, secondsInterval: Number): void; /** * Internal scheduler method. * @param processName * @param routine * @param cronExpression * @private */ private schedule; }