WXL
3 天以前 9bce51f651aad297ef9eb6df832bfdaf1de05d84
node_modules/webpack/lib/util/AsyncQueue.js
@@ -17,6 +17,7 @@
let inHandleResult = 0;
/**
 * Defines the callback callback.
 * @template T
 * @callback Callback
 * @param {(WebpackError | null)=} err
@@ -25,12 +26,14 @@
 */
/**
 * Represents AsyncQueueEntry.
 * @template T
 * @template K
 * @template R
 */
class AsyncQueueEntry {
   /**
    * Creates an instance of AsyncQueueEntry.
    * @param {T} item the item
    * @param {Callback<R>} callback the callback
    */
@@ -50,22 +53,26 @@
}
/**
 * Defines the get key type used by this module.
 * @template T, K
 * @typedef {(item: T) => K} getKey
 */
/**
 * Defines the processor type used by this module.
 * @template T, R
 * @typedef {(item: T, callback: Callback<R>) => void} Processor
 */
/**
 * Represents AsyncQueue.
 * @template T
 * @template K
 * @template R
 */
class AsyncQueue {
   /**
    * Creates an instance of AsyncQueue.
    * @param {object} options options object
    * @param {string=} options.name name of the queue
    * @param {number=} options.parallelism how many items should be processed at once
@@ -119,6 +126,7 @@
   }
   /**
    * Returns context of execution.
    * @returns {string} context of execution
    */
   getContext() {
@@ -126,6 +134,7 @@
   }
   /**
    * Updates context using the provided value.
    * @param {string} value context of execution
    */
   setContext(value) {
@@ -133,6 +142,7 @@
   }
   /**
    * Processes the provided item.
    * @param {T} item an item
    * @param {Callback<R>} callback callback function
    * @returns {void}
@@ -185,6 +195,7 @@
   }
   /**
    * Processes the provided item.
    * @param {T} item an item
    * @returns {void}
    */
@@ -225,6 +236,7 @@
   }
   /**
    * Describes how this stop operation behaves.
    * @returns {void}
    */
   stop() {
@@ -245,6 +257,7 @@
   }
   /**
    * Increase parallelism.
    * @returns {void}
    */
   increaseParallelism() {
@@ -258,6 +271,7 @@
   }
   /**
    * Decrease parallelism.
    * @returns {void}
    */
   decreaseParallelism() {
@@ -266,6 +280,7 @@
   }
   /**
    * Checks whether this async queue is processing.
    * @param {T} item an item
    * @returns {boolean} true, if the item is currently being processed
    */
@@ -276,6 +291,7 @@
   }
   /**
    * Checks whether this async queue is queued.
    * @param {T} item an item
    * @returns {boolean} true, if the item is currently queued
    */
@@ -286,6 +302,7 @@
   }
   /**
    * Checks whether this async queue is done.
    * @param {T} item an item
    * @returns {boolean} true, if the item is currently queued
    */
@@ -296,6 +313,7 @@
   }
   /**
    * Describes how this ensure processing operation behaves.
    * @returns {void}
    */
   _ensureProcessing() {
@@ -324,6 +342,7 @@
   }
   /**
    * Processes the provided entry.
    * @param {AsyncQueueEntry<T, K, R>} entry the entry
    * @returns {void}
    */
@@ -351,6 +370,7 @@
   }
   /**
    * Processes the provided entry.
    * @param {AsyncQueueEntry<T, K, R>} entry the entry
    * @param {(WebpackError | null)=} err error, if any
    * @param {(R | null)=} result result, if any