qdog
A tiny abstraction for working with SQS.
The name qDog may be a bit dog biased but lets be honest, qCat.fetch() just seems doomed to failure, and "CueCat" ended pretty badly for RadioShack already.
Examples
Include / Configure
npm install qdog
const QDog = ; const qDog = accessKeyId: processenvACCESS_KEY_ID secretAccessKey: processenvSECRET_ACCESS_KEY queueUrl: processenvSQS_QUEUE_URL maxMessages: 10 // number of messages to read from SQS, default is 1;
Toss a message into the Queue
qDog;
With a delay
qDog;
Fetch messages from the queue
qDog;
Drop a message no one cares about anymore.
qDog;
Continually poll for new messages
SQS is a pull based queue. A common usage pattern to process new incoming messages is to use a retry loop. For example:
var { if err throw err;} var { console; qDog; qDog;} qDog;
Run Tests
Unit:
npm test
End-To-End:
cp .env.sample .envvim .envmocha tests/e2e/*