src/Utility/External/AsyncQueue.js
/**
     * Adds a function to the queue.
     * Automatically will wrap the function in a closure to keep the function context.
     * Will also create a Promise that will be returned and will be resolved with the actual data.
     *
     * @param {Function} func - The function to run
     * @param {Boolean} [toExec=true] - Whether to auto exec the queue on add or not.
     * @param {...any} args - All arguments the function needs
     * @returns {Promise<any>}
     * @memberof AsyncQueue
     */
Adds a function to the queue.
Automatically will wrap the function in a closure to keep the function context.
Will also create a Promise that will be returned and will be resolved with the actual data.

@param {Function} func - The function to run
@param {Boolean} [toExec=true] - Whether to auto exec the queue on add or not.
@param {...any} args - All arguments the function needs
@returns {Promise}
@memberof AsyncQueue
Adds a function to the queue . Automatically will wrap the function in a closure to keep the function context . Will also create a Promise that will be returned and will be resolved with the actual data . @param { Function } func - The function to run @param { Boolean } [ toExec = true ] - Whether to auto exec the queue on add or not . @param { ... any } args - All arguments the function needs @returns { Promise } @memberof AsyncQueue
add(func, toExec = true, ...args) {
        const promise = new Promise( (resolve, reject) => {
            const fn = this.createClosure(func, resolve, reject, ...args);
            this._functions.queue(fn);
        } );
        if (toExec && !this._running) {
            this.exec();
        }
        return promise;
    }
add ( func , toExec = true , ... args ) { const promise = new Promise ( ( resolve , reject ) => { const fn = this . createClosure ( func , resolve , reject , ... args ) ; this . _functions . queue ( fn ) ; } ) ; if ( toExec && ! this . _running ) { this . exec ( ) ; } return promise ; }
Adds a function to the queue.
Adds a function to the queue .