Skip to content

houstonking-wf/dynamodb-mutex

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dynamodb-mutex

Installation :

npm install dynamodb-mutex

How to use

const mutex = require( 'dynamodb-mutex' );


let config = {
    region: 'REGION',
    accessKeyId: 'ACCESS_KEY_ID',
    accessKey: 'ACCESS_KEY',
    retryInterval: INTERVAL_TIME,
    maxTries: 3,
    tableName: 'TABLE_NAME'
};

let timeout = 2000;


const sampleMutex = new mutex(config);


sampleMutex.lock('keyName', timeout, (err, unlock) => {
  if (err) {
  	console.log('Lock failed')
  } else {
   // DO AWESOME STUFF HERE
    unlock();
  }
});


## License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%