bmutex
Mutex locks for javascript
Last updated 2 years ago by nodweber .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install bmutex 
SYNC missed versions from official npm registry.

bmutex

Mutex locks for javascript.

Usage

const {Lock} = require('bmutex');
const lock = Lock.create();

async function doSomething() {
  const unlock = await lock();
  try {
    await _doSomething();
  } finally {
    unlock();
  }
}

async function _doSomething() {
  // actually do something async
}

Contribution and License Agreement

If you contribute code to this project, you are implicitly allowing your code to be distributed under the MIT license. You are also implicitly verifying that all code is your original work. </legalese>

License

  • Copyright (c) 2017, Christopher Jeffrey (MIT License).

See LICENSE for more info.

Current Tags

  • 0.1.8                                ...           latest (2 years ago)

12 Versions

  • 0.1.8                                ...           2 years ago
  • 0.1.7                                ...           3 years ago
  • 0.1.6                                ...           8 years ago
  • 0.1.5                                ...           8 years ago
  • 0.1.4                                ...           8 years ago
  • 0.1.3                                ...           8 years ago
  • 0.1.2                                ...           8 years ago
  • 0.1.1                                ...           8 years ago
  • 0.1.0                                ...           8 years ago
  • 0.0.2                                ...           9 years ago
  • 0.0.1                                ...           9 years ago
  • 0.0.0                                ...           9 years ago
Downloads
Total 38
Today 0
This Week 0
This Month 15
Last Day 0
Last Week 5
Last Month 11
Dependencies (1)
Dev Dependencies (3)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE