1.3.4 • Published 7 years ago

dynamodb-mutex v1.3.4

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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'
    readCapacityUnits: 5, // Default 1,
    writeCapacityUnits: 5, // Default 1
};

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
1.3.4

7 years ago

1.3.3

7 years ago

1.3.2

8 years ago

1.3.1

8 years ago

1.1.9

8 years ago

1.1.8

8 years ago

1.1.7

8 years ago