1.1.14 • Published 5 months ago
puqeue v1.1.14
puqeue
Introduction
A small JS library for queuing promises.
Use
const Puqeue = require('puqeue');
const queue = new Puqeue();
await queue.add(async () {
// My todo
});
You can await multiple promises in a queue by using Promise.all
.
await Promise.all(
queue.add(async () {
console.info(1);
}),
queue.add(async () {
console.info(3);
}, { priority: 100 }),
queue.add(async () {
console.info(2);
})
);
The above example will execute one at the time, but second operation will execute last due to priority.
Default priority is
10
.
Options
You specify the maximum number of concurrent promises run with an option.
new Puqeue({ maxOperationCount: 2 });
Use
0
to indicate no limit (default is1
).
LICENSE
See LICENSE.
1.1.9
7 months ago
1.1.12
6 months ago
1.1.11
7 months ago
1.1.10
7 months ago
1.1.14
5 months ago
1.1.13
6 months ago
1.1.8
9 months ago
1.1.7
9 months ago
1.1.6
10 months ago
1.1.5
11 months ago
1.1.4
1 year ago
1.1.3
1 year ago
1.1.2
1 year ago
1.1.1
1 year ago
1.0.19
1 year ago
1.1.0
1 year ago
1.0.18
1 year ago
1.0.17
2 years ago
1.0.16
2 years ago
1.0.15
2 years ago
1.0.14
2 years ago
1.0.13
2 years ago
1.0.12
2 years ago
1.0.11
2 years ago
1.0.10
3 years ago
1.0.9
3 years ago
1.0.8
3 years ago
1.0.7
3 years ago
1.0.6
3 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago