Skip to content

Conversation

@nirmalgupta
Copy link

I have added promise wrapper on Lock object. This is an added functionality and does not change any existing one. Usage is

const {AsyncLock}   = require('lock')
const lock = AsyncLock()
lock(['A', 'B', 'C'], function(){
    //do an async operation
    return someAsyncOperation(args)
    
}).then(function(result){
  //A, B & C are now unlocked!
}).catch(function(e){ 
// error thrown by someAsyncOperation(args) 
})

Please review and merge this code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant