Skip to content

Commit

Permalink
updates meta
Browse files Browse the repository at this point in the history
  • Loading branch information
ivoputzer committed Mar 20, 2017
1 parent d10e66e commit c8aa922
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "m.queue",
"version": "1.0.0",
"description": "",
"version": "1.0.1",
"description": "m(icro)queue is a lightweight es6+ library that exports an asynchronous function queue with adjustable concurrency",
"main": "index.js",
"scripts": {
"node": "node",
Expand Down
31 changes: 30 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# m.queue
[![travis](https://img.shields.io/travis/ivoputzer/m.queue.svg?style=flat-square)](https://travis-ci.org/ivoputzer/m.queue) [![npm-dependencies](https://img.shields.io/badge/dependencies-none-blue.svg?style=flat-square&colorB=44CC11)](package.json) [![standard-js](https://img.shields.io/badge/coding%20style-standard-brightgreen.svg?style=flat-square)](http://standardjs.com/) [![coverage](https://coveralls.io/repos/github/ivoputzer/m.queue/badge.svg?branch=master)](https://coveralls.io/github/ivoputzer/m.queue?branch=master) [![npm-package-quality](http://npm.packagequality.com/shield/m.queue.svg?style=flat-square&colorB=44CC11)](http://packagequality.com/#?package=m.queue) [![npm-node-version](https://img.shields.io/badge/node-6%2B-blue.svg?style=flat-square)](https://nodejs.org/docs/v6.0.0/api) [![npm-version](https://img.shields.io/npm/v/m.queue.svg?style=flat-square&colorB=007EC6)](https://www.npmjs.com/package/m.queue) [![npm-license](https://img.shields.io/npm/l/m.queue.svg?style=flat-square&colorB=007EC6)](https://spdx.org/licenses/MIT)

**[m(icro)](https://github.com/ivoputzer/m.cro#readme)[queue](https://github.com/ivoputzer/m.queue)** is a lightweight es6+ library that exports an asynchronous function queue with adjustable concurrency.

## .async
creates a `queue` object with the specified `concurrency`. tasks added to the queue are processed in parallel (up to the concurrency limit). if all `workers` are in progress, the task is queued until one becomes available. once a `worker` completes a task, that task's callback is called.

```javascript
const {async} = require('m.queue')

const queue = async(function worker (arg0, arg1, callback) {
if (err) {
done(err)
return
}
callback([err], arg0, arg1)
}, 10)
```

### queue.resume()
### queue.pause()
### queue.drain([callback]) // set concurrency to infinite and notify when idle again
### queue.unshift([...args, callback]])
### queue.push([..args, callback])

### queue.length()
### queue.shift()
### queue.pop()



coming soon!

0 comments on commit c8aa922

Please sign in to comment.