@seedalpha/sqs
v1.2.10
Published
Wrapper around amazon simple queue service, used as a provider for `seedalpha/JobQueue`
Downloads
1
Readme
Amazon Simple Queue Service
Wrapper around amazon simple queue service, used as a provider for seedalpha/JobQueue
Changelog
1.2.0
:
- option timeout as VisibilityTimeout for Amazon SQS
1.1.2
:
- update
aws-sdk
1.1.1
:
- ci integration & badge
1.1.0
:
- change name for private repository
- update version
Prerequisites
$ npm set registry http://npm.sandbox.elasticseed.net
$ npm set always-auth true
$ npm login
$ export AMAZON_ACCESS_KEY_ID="abc"
$ export AMAZON_ACCESS_KEY_SECRET="123"
Installation
$ npm install seed-sqs --save
Usage
var queue = new Queue({
name: 'test-queue',
key: process.env.AMAZON_ACCESS_KEY_ID,
secret: process.env.AMAZON_ACCESS_KEY_SECRET,
timeout: 30
});
// push messages to the queue
queue.push({ hello: 'world' }, function(error) {
// pull messages from the queue (long poll for 20s, auto-retry)
queue.pull(function(error, message) {
console.log(message.Body); // { hello: 'world' }
// remove messages from the queue (avoid duplication)
queue.release(message, function(error) {
// message removed from queue
// delete queue
queue.reset(function(error) {
// queue deleted
});
});
});
});
Development
$ git clone [email protected]:seedalpha/sqs.git
$ cd sqs
$ npm install
$ npm test
Author
Vladimir Popov [email protected]
License
©2014 Seedalpha