sdk/src/Utilities/taskRunner.js
function run(task) {
        return Platform.async(function(callback) {
            // parameter validation
            Validate.isFunction(task);
            Validate.isFunction(callback);
            
            // Add the task to the queue of pending tasks and trigger task processing
            queue.push({
                task: task,
                callback: callback
            });
            processTask();
        })();
    }
function run(task) {
        return Platform.async(function(callback) {
            // parameter validation
            Validate.isFunction(task);
            Validate.isFunction(callback);
            
            // Add the task to the queue of pending tasks and trigger task processing
            queue.push({
                task: task,
                callback: callback
            });
            processTask();
        })();
    }
function run ( task ) { return Platform . async ( function ( callback ) { // parameter validation Validate . isFunction ( task ) ; Validate . isFunction ( callback ) ; // Add the task to the queue of pending tasks and trigger task processing queue . push ( { task : task , callback : callback } ) ; processTask ( ) ; } ) ( ) ; }
Runs the specified task asynchronously after all the earlier tasks have completed
@param task Function / task to be executed. The task can either be a synchronous function or can return a promise.
@returns A promise that is resolved with the value returned by the task. If the task fails the promise is rejected.
Runs the specified task asynchronously after all the earlier tasks have completed