Type Alias StartQueuedTaskFn<T>

StartQueuedTaskFn<T>: ((taskName?: string) => T | IPromise<T>)

Identifies the function to call to start and execute the task when its ready to be executed.

Type Parameters

  • T

Type declaration

    • (taskName?): T | IPromise<T>
    • Parameters

      • OptionaltaskName: string

        The optional task name that was assigned to this task, it is passed by the task scheduler.

      Returns T | IPromise<T>

      The result or a IPromise that will be resolved / rejected when the task was completed.

0.2.0

function taskFunc1() {
return 42;
}

function taskFunc2(taskName: string) {
console.log("Running Task: " + taskName);
return fetch("https://example.com/xxxx").then((response) => {
// ...
});
}

function taskFunc3() {
return Promise.all([...]);
}

function taskFunc4() {
return createAllPromise([...]);
}

function taskFunc5(taskName: string) {
return createPromise(() => {
scheduleTimeout(() => {
console.log("Completing task: " + taskName);
resolve(true);
}, 100);
});
}