Created
November 17, 2017 15:29
-
-
Save lornajane/be416ec042af5c14d7b6276a22d9912c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main(args) { | |
return new Promise(function(resolve, reject) { | |
var openwhisk = require('openwhisk'); | |
var ow = openwhisk(); | |
var actions = args.items.map(function (item) { | |
console.log(item.question_id + ": " + item.title); | |
return ow.actions.invoke({actionName: "stackoverflow/qhandler", params: {question: item}}); | |
}); | |
return Promise.all(actions).then(function (results) { | |
return resolve({payload: "All OK: " + results.length + " qhandler activations"}); | |
}); | |
}); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment