# conker

> A simple concurrency manager

Latest version **0.1.2** (published 2014-10-07) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install conker
pnpm add conker
yarn add conker
bun add conker
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2014-10-07 |
| First published | 2014-10-07 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Karl Stoney |
| Maintainers | stono |

## Links

- npm: https://www.npmjs.com/package/conker
- Repository: git@github.com:Stono/conker
- Homepage: https://github.com/Stono/conker
- Issues: https://github.com/Stono/conker/issues
- npm.io page: https://npm.io/package/conker

## Dependencies (1)

- [when](https://npm.io/package/when.md) ^3.5.0

## Recent versions

- 0.1.2 (latest) — 2014-10-07
- 0.1.1 — 2014-10-07
- 0.1.0 — 2014-10-07

## README

# conker
A simple concurrency manager for nodejs.  Basically this is to facilitate situations where you want to control the maximum number of async delegates that can be executed at any time for a single "concurrency key".

## Getting Started
Install the module with: `npm install conker`

## Examples
I have a remote API server, and want to ensure that I do no more than a maximum of 1 request at any given time, and subsequence requests should be queued until that point.
```javascript
var conker = new require('conker')({
  maxPerKey: 1
});

var concurrencyKey = 'some-api-identifier';
conker
  .start(concurrencyKey, function(callback) {
    myApi.doSomething(callback);
  })
  .then(function(result) {
    // Success!  
  })
  .then(null, function(err) {
    // Fail :'(
  });

conker
  .start(concurrencyKey, function(callback) {
    // This request wont happen until the request above completes or fails, as our maxPerKey is set to 1
    myApi.doSomethingElse(callback);
  })
  .then(function(result) {
    // Success!  
  })
  .then(null, function(err) {
    // Fail :'(
  });
```

## Contributing
TDD please.  Write a test, pass it, refactor it and then submit a merge request.

## Release History
 - 0.1.0 - Initial Release
 - 0.1.1 - Bug Fixes
 - 0.1.2 - Version bump

## License
Copyright (c) 2014 Karl Stoney  
Licensed under the MIT license.

---
_Source: https://npm.io/package/conker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
