2.0.0 • Published 8 years ago

queue5 v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

Queue5

A simple queue for javascript. Chinese document

Install

$ npm install queue5

Use

Simple:

const queue=require('Queue5');

const arr = [];
for (let i = 0; i < 100; i += 1) {
  arr.push(1000 + i);
}
queue(arr, 10, (item, next) => {
  setTimeout((val) => {
      console.log(val);
      next();      // Here is the condition that the queue can carry out
    }, item, item);
});

Professional:

const queue=require('Queue5');

const arr = [];
for (let i = 0; i < 100; i += 1) {
  arr.push(1000 + i);
}

async function test(args) {
  const result = await queue(args, 20, (item, next) => {
    setTimeout(() => {
      next('next');      // Pass data through next()
    }, item);
  });
  console.log(result);  //The final result is an Array
}

test(arr);

License

The MIT License。Please enjoy free source。

2.0.0

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago