Comparing version 0.0.1 to 0.0.2
@@ -55,6 +55,8 @@ /* | ||
var sns = new AWS.SNS(); | ||
return { | ||
progress : notifier(options.progressing), | ||
completed : notifier(options.completed), | ||
error : notifier(options.error) | ||
progress : notifier(sns, options.progressing), | ||
completed : notifier(sns, options.completed), | ||
error : notifier(sns, options.error) | ||
}; | ||
@@ -61,0 +63,0 @@ }; |
'use strict'; | ||
var AWS = require('aws-sdk'), | ||
_ = require('lodash'); | ||
var _ = require('lodash'); | ||
@@ -10,9 +9,3 @@ var internals = {}; | ||
internals.sns = function (topicArn) { | ||
return new AWS.SNS({ | ||
params: {TopicArn: topicArn} | ||
}); | ||
}; | ||
internals.snsNotifier = function (sns) { | ||
internals.snsNotifier = function (sns, topicArn) { | ||
return function (subject, message, callback) { | ||
@@ -30,3 +23,3 @@ callback = callback || internals.identity; | ||
var params = {Message: message}; | ||
var params = {TopicArn: topicArn, Message: message}; | ||
@@ -41,5 +34,5 @@ if(subject) { | ||
module.exports = function (topicArn) { | ||
module.exports = function (sns, topicArn) { | ||
if(topicArn) { | ||
return internals.snsNotifier(internals.sns(topicArn)); | ||
return internals.snsNotifier(sns, topicArn); | ||
} else { | ||
@@ -46,0 +39,0 @@ return internals.identity; |
{ | ||
"name": "cowork", | ||
"description": "job queue backed by AWS", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"homepage": "https://github.com/ryanfitz/node-cowork", | ||
@@ -6,0 +6,0 @@ "author": { |
# cowork [](http://travis-ci.org/ryanfitz/node-cowork) | ||
job queue backed by AWS | ||
distributed job queue backed by AWS | ||
@@ -5,0 +5,0 @@ ## Getting Started |
12089
291