footprintjs - v11.2.0
    Preparing search index...

    Function flushAllDetached

    • Wait for every in-flight detached handle to reach a terminal state. Returns counts for diagnostics. PROCESS-WIDE — drains every driver across every executor. For per-executor scoping, consumers should collect their own handles from executor.detachAndJoinLater(...) calls and await Promise.allSettled([...].map(h => h.wait())) themselves.

      Parameters

      Returns Promise<FlushResult>

      import { flushAllDetached } from 'footprintjs/detach';

      process.on('SIGTERM', async () => {
      const stats = await flushAllDetached({ timeoutMs: 10_000 });
      console.log(`Drained ${stats.done} done, ${stats.failed} failed, ${stats.pending} pending.`);
      process.exit(stats.pending === 0 ? 0 : 1);
      });