Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

async-lock

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-lock - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

6

History.md

@@ -1,3 +0,7 @@

0.3.0 / 2015-03-6
0.3.1 / 2015-04-15
==================
* Use your own promise
0.3.0 / 2015-03-06
==================
* Domain reentrant

@@ -4,0 +8,0 @@

8

lib/index.js
'use strict';
var Q = require('q');
var AsyncLock = function(opts){
opts = opts || {};
this.Promise = opts.Promise || require('q');
// format: {key : [fn, fn]}

@@ -48,3 +48,3 @@ // queues[key] = null indicates no job running for key

// will return a promise
deferred = Q.defer();
deferred = this.Promise.defer();
}

@@ -111,3 +111,3 @@

// Promise mode
Q.fcall(function(){
self.Promise.try(function(){
return fn();

@@ -114,0 +114,0 @@ })

{
"name": "async-lock",
"description": "",
"version": "0.3.0",
"version": "0.3.1",
"author": "rain1017",

@@ -32,2 +32,3 @@ "private" : false,

"devDependencies": {
"bluebird": "~2.9.24",
"lodash": "~3.3.0",

@@ -34,0 +35,0 @@ "should": "~5.1.0",

@@ -107,2 +107,5 @@ # async-lock

lock.isBusy();
// Use your own promise
var lock = new AsyncLock({Promise : require('bluebird')});
```

@@ -109,0 +112,0 @@

@@ -214,2 +214,8 @@ 'use strict';

it('use bluebird promise', function(done){
var lock = new AsyncLock({Promise : require('bluebird')});
lock.acquire('key', function(){})
.nodeify(done);
});
it('invalid parameter', function(done){

@@ -216,0 +222,0 @@ var lock = new AsyncLock();

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc