zqueue

0.1.1 • Public • Published

ZQueue

Queue and run promise based jobs. Can be used to control the use of resources like upload bandwith effectively.

Example

import { ZQueue } from 'zqueue';
import axios from 'axios';

const queue = ZQueue({ max: 3 });

queue.run(() => axios.put(myUrl1, file1));
queue.run(() => axios.put(myUrl2, file2));
queue.run(() => axios.put(myUrl3, file3));
queue.run(() => axios.put(myUrl4, file4));
queue.run(() => axios.put(myUrl5, file5));

// A maximum of 3 uploads will be ran at the same time.

Readme

Keywords

none

Package Sidebar

Install

npm i zqueue

Weekly Downloads

526

Version

0.1.1

License

MIT

Unpacked Size

10.3 kB

Total Files

9

Last publish

Collaborators

  • andressrg