mediaforge - v2.2.0
    Preparing search index...

    Function queued

    • Run fn through the process-wide queue.

      Sugar for getDefaultQueue. Pass concurrency once, or on every call — the same value reuses the same queue, so the cap is actually enforced:

      Type Parameters

      • T

      Parameters

      • fn: () => Promise<T>
      • options: QueueOptions & { signal?: AbortSignal } = {}

      Returns Promise<T>

      // Set it once at startup:
      getDefaultQueue({ concurrency: 4 });

      // or per call, with the same value:
      await queued(() => transcode(a));
      await queued(() => transcode(b));