flow type: TaskRet = any
Type: any
flow type: Task = (depRets?:{ [taskKey:string]: any }) => Promise<TaskRet>;
Type: function (depRets: {}): Promise<TaskRet>
Creates an instance of TaskScheduler.
Add a task. Must be called before start() is called. Should not be called more than once for each task or all except the last one is effective. There is no requirements in the order in which tasks are added. A task must return a promise, if a task is synchronous, just wrap the return value in a promise, like return Promise.resolve(whatEver);
Parameters
Returns any
Add a task after start() is called. Name should not already be added previously otherwise the behaviour is not defined.
Parameters
Returns any
Begin executing all tasks. Each task is executed only after its dependent tasks have already finished and receive their returned values as a 'taskName -> value' map in a single argument. Tasks that have no dependent tasks or all its depended tasks have finished will be executed concurrently.
Returns Promise<{}>