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.2 to 0.3.3

4

History.md

@@ -0,1 +1,5 @@

0.3.3 / 2015-05-19
==================
* Bug fix
0.3.2 / 2015-05-08

@@ -2,0 +6,0 @@ ==================

@@ -160,4 +160,8 @@ 'use strict';

AsyncLock.prototype._acquireBatch = function(keys, fn, cb, opts){
if(typeof(cb) !== 'function'){
opts = cb;
cb = null;
}
var self = this;
var getFn = function(key, fn){

@@ -173,3 +177,18 @@ return function(cb){

});
fnx(cb);
if(typeof(cb) === 'function'){
fnx(cb);
}
else{
var deferred = Promise.defer();
fnx(function(err, ret){
if(err){
deferred.reject(err);
}
else{
deferred.resolve(ret);
}
});
return deferred.promise;
}
};

@@ -176,0 +195,0 @@

2

package.json
{
"name": "async-lock",
"description": "",
"version": "0.3.2",
"version": "0.3.3",
"author": "rain1017",

@@ -6,0 +6,0 @@ "private" : false,

@@ -148,8 +148,26 @@ 'use strict';

});
})).then(function(){
}))
.then(function(){
assert(value === concurrency);
done();
}, function(err){
done(err);
});
})
.then(function(){
var key1 = false, key2 = false;
lock.acquire('key1', function(){
key1 = true;
return Q.delay(20).then(function(){
key1 = false;
});
});
lock.acquire('key2', function(){
key2 = true;
return Q.delay(10).then(function(){
key2 = false;
});
});
return lock.acquire(['key1', 'key2'], function(){
assert(key1 === false && key2 === false);
});
})
.nodeify(done);
});

@@ -156,0 +174,0 @@

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