/** * Async Task Scheduler * * Schedules asynchronous tasks after transaction completion. * * Key features: * 1. Queueing: Add async tasks to queue * 2. Background execution: Execute in background after transaction commit * 3. Error isolation: Async task failures don't affect main logic * 4. Logging: Log execution status */ import { AsyncTaskInfo, Context } from './types'; /** * Async Task Scheduler class */ export declare class AsyncTaskScheduler { private readonly tasks; private readonly context; /** * Debug mode caching (performance optimization) * Check environment variable only once at class load instead of every call * * Logging policy (simple rules): * * 1. Test environment: Always OFF (for clean test output) * - NODE_ENV=test → No logs * * 2. Explicit control (highest priority): * - FEATURE_LOGS=true → Force ON (any environment except test) * - FEATURE_LOGS=false → Force OFF (any environment) * * 3. Default behavior (when FEATURE_LOGS not set): * - development → ON (helpful for debugging) * - production → OFF (clean production logs) */ private static readonly isDebugMode; constructor(tasks: AsyncTaskInfo[], context: Context); /** * Schedule all Async Tasks * * This method returns immediately, and tasks are executed in the background. */ schedule(): void; /** * Execute all Async Tasks in background */ private executeInBackground; /** * Execute single Async Task * * @param task - Async Task to execute */ private executeTask; /** * Output log * * @param message - Log message */ private log; /** * Output error log * * @param message - Error message */ private logError; } /** * Schedule Async Tasks (helper function) * * @param tasks - Async Task list * @param context - Context object */ export declare function scheduleAsyncTasks(tasks: AsyncTaskInfo[], context: Context): void; //# sourceMappingURL=async-task-scheduler.d.ts.map