Skip to content

Instantly share code, notes, and snippets.

@lornajane
Created November 17, 2017 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lornajane/be416ec042af5c14d7b6276a22d9912c to your computer and use it in GitHub Desktop.
Save lornajane/be416ec042af5c14d7b6276a22d9912c to your computer and use it in GitHub Desktop.
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