@vgerbot/async
    Preparing search index...

    Class PriorityPoolExecutor

    A task executor that processes tasks with priority support. Tasks with higher priority values are executed first. Uses an internal max-heap priority queue for scheduling, with a pool of concurrent workers that pull the highest-priority pending task when freed.

    The exec() method accepts PriorityTaskOptions, which extends TaskOptions with an optional priority field (default 0).

    const executor = new PriorityPoolExecutor(2);

    executor.exec(async () => "low", { priority: 1 });
    executor.exec(async () => "high", { priority: 10 });
    executor.exec(async () => "medium", { priority: 5 });

    // Executes in order: high (10), medium (5), low (1)

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Checks if the executor is shut down and throws ExecutorShutdownError if so. Subclasses should call this at the start of exec().

      Parameters

      • message: string = "Executor permanently shut down"

        Optional custom error message

      Returns void

      if the executor is shut down