task-chain

1.0.1 • Public • Published

task-chain

this is project is about running tasks one by one.

for eack banch of tasks, you need to create a task runner:

let chainTaskRunner = new ChainTaskRunner();

after that, you can push your task to the task runner:

let chainTask1 = new ChainTask(()->{ setTimeout(function(){chainTask1.end()}, 2000) });

chainTaskRunner.addTask(chainTask1);

but in your processer or your task, you need to call

yourTask.end()

to end the task, if you donot end the task manually, the task will keep running~!

for more detail, you can refer to example: ChainTaskTester.js

GITHUB: https://github.com/jessechen0319/task-chain

Readme

Keywords

none

Package Sidebar

Install

npm i task-chain

Weekly Downloads

3

Version

1.0.1

License

ISC

Unpacked Size

4.18 kB

Total Files

6

Last publish

Collaborators

  • jessechen