GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — claude-code-source-code/src/utils/cleanupRegistry.ts at main · schelling/claude-code-source-code Expand file tree/ Copy pathcleanupRegistry.tsMore file actions 25 lines (22 loc) · 900 Bytes / Copy pathcleanupRegistry.tsFile metadata and controls25 lines (22 loc) · 900 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 /** * Global registry for cleanup functions that should run during graceful shutdown. * This module is separate from gracefulShutdown.ts to avoid circular dependencies. */ // Global registry for cleanup functions const cleanupFunctions = new Set<() => Promise<void>>() /** * Register a cleanup function to run during graceful shutdown. * @param cleanupFn - Function to run during cleanup (can be sync or async) * @returns Unregister function that removes the cleanup handler */ export function registerCleanup(cleanupFn: () => Promise<void>): () => void { cleanupFunctions.add(cleanupFn) return () => cleanupFunctions.delete(cleanupFn) // Return unregister function } /** * Run all registered cleanup functions. * Used internally by gracefulShutdown. */ export async function runCleanupFunctions(): Promise<void> { await Promise.all(Array.from(cleanupFunctions).map(fn => fn())) } |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |